I am coding in python.
Let us say when the program starts, the user is prompted with the following:
Press 1) to check what the temperature is outside.
Press 2) to find out how many miles are on your car.
Press 3) to see how full your gas tank is.
Press 4) to find out how much money you made last week.
Whatever the user types in, the if statement is executed. I want this program to keep going until the user types quit. Nonetheless, as a user, I want to be able to keep hitting 1) or 2) as many times as I want.
The only thing that will stop this program is if the user types "quit."
How would I go about doing this? Do I need a while loop comprised of if statements? If so, how would I go about doing that?
Thanks!
Aucun commentaire:
Enregistrer un commentaire