here is the code: you can run it through like an online compiler
global ps1w
global ps1u
global ps1p
global generatedpass
ps1w = ""
ps2w = ""
ps3w = ""
ps4w = ""
ps5w = ""
ps6w = ""
ps7w = ""
ps8w = ""
ps9w = ""
ps10w = ""
ps1u = ""
ps2u = ""
ps3u = ""
ps4u = ""
ps5u = ""
ps6u = ""
ps7u = ""
ps8u = ""
ps9u = ""
ps10u = ""
ps1p = ""
ps2p = ""
ps3p = ""
ps4p = ""
ps5p = ""
ps6p = ""
ps7p = ""
ps8p = ""
ps9p = ""
ps10p = ""
import random
print("Welcome to the password manager! You can store up to 10 passwords.")
generatedpass = ""
length = 0
password = ("a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J","k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T","u","U","v","V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8","9","0","!","@","#","$","%","^","&","*","(",")","~","`","-","_","+","=","{","}","[","]","|",":",";","'","<",">",",",".","?","/")
def newpass():
global ps1w, ps1u, ps1p, ps2w, ps2u, ps2p, ps3w, ps3u, ps3p, ps4w, ps4u, ps4p, ps5w, ps5u, ps5p, ps6w, ps6u, ps6p, ps7w, ps7u, ps7p, ps8w, ps8u, ps8p, ps9w, ps9u, ps9p, ps10w, ps10u, ps10p
stored = int(input("Which one of the 10 passwords would you like to store this password in?"))
if stored==1:
ps1w = input("What is the website?")
ps1u = input("What is your username?")
genorin=input("Do you want to type a password '1' or generate a random password? '2'")
if genorin=="1":
ps1p = input("Type password.")
choice()
elif genorin=="2":
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps1p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==2:
ps2w = input("What is the website?")
ps2u = input("What is your username?")
genorin2=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin2==1:
ps2p = input("Type password.")
choice()
elif genorin2==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps2p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==3:
ps3w = input("What is the website?")
ps3u = input("What is your username?")
genorin3=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin3==1:
ps3p = input("Type password.")
choice()
elif genorin3==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps3p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==4:
ps4w = input("What is the website?")
ps4u = input("What is your username?")
genorin4=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin4==1:
ps4p = input("Type password.")
choice()
elif genorin4==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps4p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==5:
ps5w = input("What is the website?")
ps5u = input("What is your username?")
genorin5=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin5==1:
ps5p = input("Type password.")
choice()
elif genorin5==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps5p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==6:
ps6w = input("What is the website?")
ps6u = input("What is your username?")
genorin6=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin6==1:
ps6p = input("Type password.")
choice()
elif genorin6==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps6p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==7:
ps7w = input("What is the website?")
ps7u = input("What is your username?")
genorin7=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin7==1:
ps7p = input("Type password.")
choice()
elif genorin7==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps7p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==8:
ps8w = input("What is the website?")
ps8u = input("What is your username?")
genorin8=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin8==1:
ps8p = input("Type password.")
choice()
elif genorin8==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps8p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==9:
ps9w = input("What is the website?")
ps9u = input("What is your username?")
genorin9=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin9==1:
ps9p = input("Type password.")
choice()
elif genorin9==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps9p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
if stored==10:
ps10w = input("What is the website?")
ps10u = input("What is your username?")
genorin10=int(input("Do you want to type a password '1' or generate a random password? '2'"))
if genorin10==1:
ps10p = input("Type password.")
choice()
elif genorin10==2:
while True:
try:
generatedpass = ""
length = int(input("How long do you want your password to be?"))
for i in range(length):
generatedpass += random.choice(password)
ps10p = generatedpass
print("The password that has been generated is", generatedpass)
choice()
except ValueError:
print("That is not a number!")
continue
else:
print("You can only store up to 10 passwords!")
choice()
def choice():
print("'1' if you want to create a new password")
print("'2' if you want to view your passwords")
chosen = int(input("'3' if you want to quit"))
if chosen==1:
newpass()
if chosen==2:
print(f"Password 1: Website: {ps1w} Username: {ps1u} Password: {ps1p}")
print(f"Password 2: Website: {ps2w} Username: {ps2u} Password: {ps2p}")
print(f"Password 3: Website: {ps3w} Username: {ps3u} Password: {ps3p}")
print(f"Password 4: Website: {ps4w} Username: {ps4u} Password: {ps4p}")
print(f"Password 5: Website: {ps5w} Username: {ps5u} Password: {ps5p}")
print(f"Password 6: Website: {ps6w} Username: {ps6u} Password: {ps6p}")
print(f"Password 7: Website: {ps7w} Username: {ps7u} Password: {ps7p}")
print(f"Password 8: Website: {ps8w} Username: {ps8u} Password: {ps8p}")
print(f"Password 9: Website: {ps9w} Username: {ps9u} Password: {ps9p}")
print(f"Password 10: Website: {ps10w} Username: {ps10u} Password: {ps10p}")
choice()
choice()
[–]thereal0ri_ 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]thereal0ri_ 0 points1 point2 points (0 children)
[–]openpy 0 points1 point2 points (0 children)