I am a python newbie and have been asked to carry out some exercises using while and for loops. I have been asked to make a program loop until exit is requested by the user
I ran into this page while (no pun) looking for something else. Here is what I use:
while True: i = input("Enter text (or Enter to quit): ") if not i: break print("Your input:", i) print("While loop has exited")