From f83cebeb2dc2115565568789448c1ef08f487363 Mon Sep 17 00:00:00 2001 From: stathisraf <61472058+stathisraf@users.noreply.github.com> Date: Tue, 26 Oct 2021 16:14:24 +0300 Subject: [PATCH] PasswordGenerator we input whatever kind of strings we want and we get a random password, generated by our input --- python/arrays/PasswordGenerator.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 python/arrays/PasswordGenerator.py diff --git a/python/arrays/PasswordGenerator.py b/python/arrays/PasswordGenerator.py new file mode 100644 index 0000000..0fcc7c1 --- /dev/null +++ b/python/arrays/PasswordGenerator.py @@ -0,0 +1,21 @@ +import random + + +a = [] +x = input("Please enter a string, type 000 to exit: ") +while x != "000" : + a.append(x) + x = input("Please enter a string, type 000 to exit: ") + +if len((a)) >= 3: + n1 = random.randint(0,len(a)-1) + n2 = random.randint(0,len(a)-1) + n3 = random.randint(0,len(a)-1) + x1 = a[n1] + x2 = a[n2] + x3 = a[n3] + pejo= x1+x2+x3 + print("Your New Password is: " + pejo ) +else: + print("You Need at least Three Strings") +