Dec-12-2019, 03:19 AM
I'm trying to remove an item from the passwords list.
I keep getting Traceback (most recent call last):
passwords.remove(websitetodelete) #This line is where I'm hung up. Trying to remove the websitetodelete from the previous line. I'm sure i'm not referencing the list correctly.
ValueError: list.remove(x): x not in list
Not sure
I keep getting Traceback (most recent call last):
passwords.remove(websitetodelete) #This line is where I'm hung up. Trying to remove the websitetodelete from the previous line. I'm sure i'm not referencing the list correctly.
ValueError: list.remove(x): x not in list
Not sure
passwords = [["yahoo","XqffoZeo"],["google","CoIushujSetu"]] while True: print("What would you like to do:") print(" 1. Open password file") print(" 2. Lookup a password") print(" 3. Add a password") print(" 4. Save password file") print(" 5. Print the encrypted password list (for testing)") print(" 6. Quit program") print(" 7. Delete a password") print("Please enter a number (1-7)") choice = input() if(choice == '7'): #Delete a password print("Which website do you want to delete?") for keyvalue in passwords: print(keyvalue[0]) #Printing the list of websites for the user to choose from. websitetodelete = input() #Accepting the user's input for the website to remove. passwords.remove(websitetodelete) #This line is where I'm hung up. Trying to remove the websitetodelete from the previous line. I'm sure i'm not referencing the list correctly.