forked from csfx-py/hacktober2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path323_Python_Project.py
64 lines (40 loc) · 1.42 KB
/
323_Python_Project.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#Password_Generator
import random
import string
passw=""
#Define Set of Strings and Characters that password will contain
Number= string.digits
symbols = string.punctuation
all_letters= string.ascii_letters
#Declare set for 3 difficulty levels
Easy = all_letters
Medium = all_letters + Number
Hard = all_letters+symbols+Number
#Taking Input from User for Length Of Password
print("Enter the length of the password you want:\n",end="")
len=int(input())
#Setting the number of generated passwords
print("Enter the number of passwords to be generated")
gen=int(input())
#Setting the Strength of Password
print("Enter the strength of the password you want to set\n")
print('''Enter 1 for Easy
Enter 2 for Medium
Enter 3 for Hard''')
choice=int(input())
for j in range(gen):
if choice==1:
for i in range(len):
passw = random.choice(Easy) #Choose a character from the EASY set of string
print(passw,end="")
elif choice==2:
for i in range(len):
passw=random.choice(Medium) #Choose a character from the Medium set of string
print(passw,end="")
elif choice==3:
for i in range(len):
passw=random.choice(Hard) #Choose a character from the Hard set of string
print(passw,end="")
else:
print("Invalid Choice")
print("\n")