143k views
3 votes
Write a program that asks the user to enter a city name, and then prints Oh! CITY is a cool spot. Your program should repeat these steps until the user inputs Nope.

Sample Run:
Please enter a city name: (Nope to end) San Antonio
Oh! San Antonio is a cool spot.
Please enter a city name: (Nope to end) Los Angeles
Oh! Los Angeles is a cool spot.
Please enter a city name: (Nope to end) Portland
Oh! Portland is a cool spot.
Please enter a city name: (Nope to end) Miami
Oh! Miami is a cool spot.
Please enter a city name: (Nope to end) Nope

User Mastrianni
by
4.1k points

1 Answer

2 votes

user_name = input("Please enter city name to run the program: ")

while( user_name != "Nope" ):

print("Nice to meet you ", user_name )

user_name = input("Please enter a name or type Nope to terminate the program: ")

I hope this helps!

User Wolfsgang
by
3.8k points