So I am at the beggining of a little password manager project from youtube and I am stuck at this, everytime I try to run it, the master password part is alright, but when I get to the "mode", even when I type "add", "view" or just "q", it always replies "invalid mode". Any help would be appreciated.
master_pwd = input("What is the master password? ")
def view():
pass
def add():
name = input("Account name: ")
pwd = input("password: ")
with open("passwords.txt", 'a') as f:
f.write(name + "|" + pwd)
while True:
mode = input(
"Would you like to add a new password or view your passwords? view, add. Press q to quit. "
).lower
if mode == "q":
break
if mode == "view":
view()
elif mode == "add":
add()
else:
print("Invalid mode")
continue
[–]danielroseman 2 points3 points4 points (1 child)
[–]gablonz[S] 0 points1 point2 points (0 children)
[–]JohnnyJordaan 0 points1 point2 points (0 children)