-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPass.py
42 lines (34 loc) · 1.12 KB
/
Pass.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
#Imports
import random
import string
#Define
def Ask():
#Ask
while True:
Again = input("New Password? (Y/N)")
if Again == "y" or Again == "Y":
#Setup Variables
#Input Length
while True:
user_input = input("Password Length:")
if user_input.isdigit():
Length = int(user_input)
print("Valid Input... Proccessing")
break
else:
print("Invalid Input... Please Try Again")
#Final Product
password = ""
#Generate Characters
for i in range(Length):
Char = str(random.choice(string.ascii_letters + string.digits + string.punctuation))
password += Char
#Output Password
print(password)
elif Again == "n" or Again == "N":
print("Thank You. Have A Nice Day :)")
break
else:
print("Invalid Input... Please Try Again")
#First Call
Ask()