Skip to content

Commit d7134ba

Browse files
authored
Add files via upload
1 parent 33ea1ff commit d7134ba

File tree

1 file changed

+30
-0
lines changed
  • Hard_Level_Password_Generator

1 file changed

+30
-0
lines changed

Hard_Level_Password_Generator/main.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import random
2+
3+
print("Welcome to password generator.")
4+
l = int(input("How many letters do you want in your passwords: "))
5+
n = int(input("How many numbers do you want in your passwords: "))
6+
s = int(input("How many symbols do you want in your passwords: "))
7+
8+
letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
9+
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
10+
]
11+
numbers = ['1','2','3','4','5','6','7','8','9','0']
12+
symbols = ['!','@','#','$','%','&','*','(',')','-','+']
13+
password_list =[]
14+
for i in range(1,l+1):
15+
char = random.choice(letters)
16+
password_list += char
17+
18+
for i in range(1,n+1):
19+
char = random.choice(numbers)
20+
password_list += char
21+
22+
for i in range(1,s+1):
23+
char = random.choice(symbols)
24+
password_list += char
25+
random.shuffle(password_list)
26+
27+
password = ""
28+
for char in password_list:
29+
password += char
30+
print(password)

0 commit comments

Comments
 (0)