-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumeric.py
More file actions
57 lines (44 loc) · 1.63 KB
/
numeric.py
File metadata and controls
57 lines (44 loc) · 1.63 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# modules
import random
# style
print("Hello welcome to random numeric password generator 1.0 VOL")
print("")
# name
name = str(input("Enter your name : "))
# start
numbers = "0987654321"
passwords = int(input("How many passwords do you want? : "))
pwdArray = [0]*passwords
password_length = int(input("How many numbers do you want in your password? : "))
add_name = str(input("Do you want to add your name? (not recommended) [y/n] : "))
special_remarks = str(input("Any special remarks? : "))
# start generator
if add_name == 'y':
for i in range(0, passwords):
password = ""
for a in range(0, password_length):
password_characters = random.choice(numbers)
password = password + password_characters
passwords_built = name + special_remarks + password
pwdArray[i]=passwords_built
print("Your password is: ",(pwdArray))
elif add_name == 'n':
for i in range(0, passwords):
password = ""
for a in range(0, password_length):
password_characters = random.choice(numbers)
password = password + password_characters
passwords_built = special_remarks + password
pwdArray[i]=passwords_built
print("Your password is: ",(pwdArray))
# save password
save = input("Do you want to save your password? [y/n] : ")
if save == "y":
file = open(input("What is the name of your file? make sure to enter the file type : "),"a")
content=str(pwdArray)
file.write(content)
file.close()
elif save == "n":
print("OK Goodbye!")
else:
print("Nothing found")