We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd76750 commit 3f8724cCopy full SHA for 3f8724c
Password-Generator/main.py
@@ -0,0 +1,26 @@
1
+import secrets
2
+import string
3
+
4
+letters = string.ascii_letters
5
+digits = string.digits
6
+special_chars = string.punctuation
7
8
+alphabet = letters + digits + special_chars
9
10
+pwd_length = 12
11
12
+pwd = ''
13
+for i in range(pwd_length):
14
+ pwd += ''.join(secrets.choice(alphabet))
15
16
+print(pwd)
17
18
+while True:
19
+ pwd = ''
20
+ for i in range(pwd_length):
21
22
23
+ if (any(char in special_chars for char in pwd) and
24
+ sum(char in digits for char in pwd)>=2):
25
+ break
26
0 commit comments