python loop
okay, about the while loop at the very end, at the "else" statement.. at the end i forgot to add a "continue" but it still loops back up.... why?? """ from cryptography.fernet import Fernet def write_key(): key = Fernet.generate_key() with open('key.key', 'wb') as key_file: key_file.write(key) def load_key(): file = open('key.key', 'rb') key = file.read() file.close() return key key = load_key() fer = Fernet(key) def view(): with open('passwords.txt', 'r') as f: for line in f.readlines(): data = (line.rstrip()) user, passw = data.split('|') print('user:', user + '| Password:', fer.decrypt(passw.encode()).decode()) def add(): while True: name = input('Account Name: ').lower() if name.isdigit(): print('no numbers') continue else: break password = input('Password: ') with open('passwords.txt', 'a') as f: f.write(name + '|' + fer.encrypt(password.encode()).decode() + '\n') while True: mod = input('view the existing passwords or add new ones or quit? (view/add/quit): ').lower() if mod == 'q' or mod == 'quit': print('bye!') quit() if mod == 'view' or mod == 'v': print('') view() print('') elif mod == 'add' or mod == 'a': add() else: print('not a valid option')