Apr-16-2018, 08:40 AM
That's because you're getting input after the loop has already been entered.
One way to fix this would be to get input once before the loop is started, and then get it again at the end of each iteration:
One way to fix this would be to get input once before the loop is started, and then get it again at the end of each iteration:
age = input(prompt) while age.lower() != 'quit': # do stuff age = input(prompt)Another option is using a for loop with iter():
for age in iter(lambda: input(prompt).lower(), 'quit'): # do stuff