-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPasswordGenerator.py
40 lines (35 loc) · 1010 Bytes
/
PasswordGenerator.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
import random
import string
import time
print('********** PASSWORD GENERATOR **********')
password_count = int(input("How many password you want to generate? "))
length = int(input("How many characters do you want in your password? "))
#Setting length limit.
if length > 70:
print("Warning: Maximum password length is 70.")
time.sleep(1)
print("STOPPING EXECUTION...")
exit()
print("\n")
full_set = string.ascii_letters + string.digits + string.punctuation
print("Generating passwords...")
time.sleep(1)
for x in range(1, password_count + 1):
print(f"Password {x}:")
for y in range(length):
choice = random.choice(full_set)
print(choice, end='')
print("\n")
time.sleep(1)
print(f"Generated {password_count} passwords.")
strength = ""
if length <= 4:
strength = "Weak"
elif length <= 8:
strength = "Good"
elif length <= 11:
strength = "Strong"
elif length <= 70:
strength = "Very strong"
time.sleep(1)
print(f"Password Strength: {strength}")