I have tried removing multiple items from a list, but the loop ends without the ability to continue. I am to create a list of names and then use a loop to remove more than one name.
[/python]
names = [] while True: first = input("Enter first name or q to quit: ") if first.lower() == "q": break names.append(first) print() namesL = names[:] while True: x_name = input("Enter a name to remove or q to quit: ") namesL.remove(x_name) names.append(namesL) if first.lower() == "q": break else: continue print(namesL)The second while loop ends without prompting for more entries. I have tried to append list, but still does not work.I am trying to ask user to enter names and remove them from list until they enter q to quit.
[/python]
Larz60+ write Nov-01-2020, 09:31 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
I have fixed this for you this time. Please use bbcode tags in future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
I have fixed this for you this time. Please use bbcode tags in future posts.