Aug-27-2020, 06:33 PM
Look how often you ask for input. Why make a variable just to break out of the loop?
def main(): print("1) Create a new user ID") print("2) Change a password") print("3) Display all user ID's") print("4) Quit") print() while True: choice = input("Please enter your selection:") # Why make it an integer??? if choice == '1': data = getdata() newid = createid(data) password = createpassword() newrecord = newid + "," + password data.append(newrecord) with open("ID+Passwords.csv","w") as file # Closes file when done for row in data: file.write(newrecord) elif choice == '2': data = getdata() changepassword(createid(data), data) elif choice == '3': display(getdata()) elif choice == '4': break else: print("Invalid choice.")