Skip to content

Commit a785d28

Browse files
authoredOct 27, 2021
Create Password generator
1 parent a486ecc commit a785d28

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
 

‎Password generator

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import string
2+
import random
3+
from typing import List
4+
5+
if __name__ == "__main__":
6+
7+
s1 = string.ascii_lowercase
8+
s2 = string.ascii_uppercase
9+
s3 = string.digits
10+
s4 = string.punctuation
11+
12+
plen = int(input("Enter password length\n"))
13+
14+
s = []
15+
s.extend(list(s1))
16+
s.extend(list(s2))
17+
s.extend(list(s3))
18+
s.extend(list(s4))
19+
20+
random.shuffle(s)
21+
22+
print("Your password is: ")
23+
print("".join(s[0:plen]))

0 commit comments

Comments
 (0)
Please sign in to comment.