-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject2.py
More file actions
34 lines (34 loc) · 1.03 KB
/
project2.py
File metadata and controls
34 lines (34 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import random
letters=[]
for i in range(ord('A'),ord('Z')+1):
letters.append(chr(i))
for i in range(ord('a'),ord('z')+1):
letters.append(chr(i))
print(letters)
numbers=[]
for i in range(10):
numbers.append(i)
numbers[i]=str(numbers[i])
print(numbers)
symbols=['!','@','#','$','%','^','&','*','(',')','_','-','+']
print("WELCOME TO THE PASSWORD GENERATOR")
password_list=[]
n_letters=int(input(("enter how many letters would you want in your password?")))
for i in range(1,n_letters+1):
char=random.choice(letters)
password_list+=char
n_numbers=int(input("enter how many numbers you want in your password?"))
for i in range(1,n_numbers+1):
char=random.choice(numbers)
password_list+=char
n_symbols=int(input("enter how many symbols you want in your password?"))
for i in range(1,n_symbols+1):
char=random.choice(symbols)
password_list+=char
print(password_list)
random.shuffle(password_list)
print(password_list)
password=""
for i in password_list:
password+=i
print(password)