We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 977024c commit 86e00afCopy full SHA for 86e00af
Random_Password_Generator/password_generator.py
@@ -0,0 +1,34 @@
1
+import string
2
+import random
3
+
4
+char = list(string.ascii_letters + string.digits + "!@#$%^&*()")
5
6
+def generate_password():
7
+ password_length = int(input("How long would your password be: "))
8
9
+ random.shuffle(char)
10
11
+ password = []
12
13
+ for x in range(password_length):
14
+ password.append(random.choice(char))
15
16
+ random.shuffle(password)
17
18
+ password = "".join(password)
19
20
+ print(password)
21
22
+option = input("Do you want to generate a pasword? (Yes/No): ")
23
24
+if option == "Yes" or option == "yes":
25
+ generate_password()
26
+ print("")
27
28
+elif option =="No" or option == "no":
29
+ print("Program ended")
30
+ quit()
31
32
+else:
33
+ print("Invalid input")
34
0 commit comments