How can I prevent an error if the user tries to remove a movie that…
Question Answered step-by-step How can I prevent an error if the user tries to remove a movie that… How can I prevent an error if the user tries to remove a movie that is not in the list, and makes the loop starts again? mylist=[]print(“welcome to the Movies database!”)want =”??”while want != “E”: want = input(“Do you want to (A)dd, (D)elete, (S)how the list or (E)xit? “) print(want) if want == “A”: movie = input(“Enter a movie: “) print(movie) mylist.append(movie) elif want == “D”: delete = input(“Enter the movie to delete: “) print(delete) mylist.remove(delete) elif want == “S”: show(mylist) elif want == “E”: break else: print(“Invaild input”)print(“Goodbye!”) Computer Science Engineering & Technology Python Programming CMPSC 101 Share QuestionEmailCopy link Comments (0)


