Jun-20-2020, 07:13 AM
I have indented and have tried moving the 'break' statement around, but I keep receiving this error. What am I doing wrong? Thank you!
prompt = "\nPlease enter the name of a city you have visited:" prompt += "\n(Enter 'quit' when you are finished.) " while True: city = input(prompt) if city == 'quit': break else: print(f"I'd love to go to {city.title()}!")
Error:File "main.py", line 6
break
^
SyntaxError: 'break' outside loop