-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (27 loc) · 915 Bytes
/
main.py
File metadata and controls
36 lines (27 loc) · 915 Bytes
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
35
36
from random import choice
from time import sleep
small="qwertyuiopasdfghjklzxcvbnm"
cap="QWERTYUIOPASDFGHJKLZXCVBNM"
numbers="1234567890"
bajs="./!@#$%&*()_+"
password=""
password_length=input("welcome to the app.please give me your password length: ")
how_hard=input("how much do you want it complex? from 1 to 4 ? ")
if password_length.isdigit() and how_hard.isnumeric() and int(how_hard)<=4:
if how_hard == "4":
final_str = small + cap + numbers + bajs
elif how_hard == "3":
final_str = small + cap + numbers
elif how_hard == "2":
final_str = small + cap
else:
final_str = small
print("i am generating password ")
for _ in range (3):
print("*")
sleep(1)
for i in range(int(password_length)):
password+= choice(final_str)
print(f"here is your password = {password}")
else :
print ("incorrect input")