Pets are cute, but they can be expensive. Luckily, this one is free!
In the editor below, fill in the blanks (________
) so that the program asks the user what they would like to do, presents the user with a list of menu options and asks them to enter their choice. The program should then print back an appropriate response according to the table below:
Remember to use the Python reference sheet to help you with your code! Click on one of the buttons below:
1
and 3
, corresponding to an item in a number-driven menu. For each number, the program should print the appropriate text in the table above. The program should loop unless the number matches up with Quit
(3
in this example).label
and goto
to create the loop. You can name your label
whatever you want, but make sure your goto
statement is exactly the same!Below is an example of how the program should run:
What would you like to do?
1. Feed me
2. Pet me
3. Quit
Enter your choice: 1
Munch... munch... munch!
What would you like to do?
1. Feed me
2. Pet me
3. Quit
Enter your choice: 2
Pat... pat... pat!
What would you like to do?
1. Feed me
2. Pet me
3. Quit
Enter your choice: 4
Not a valid option!
What would you like to do?
1. Feed me
2. Pet me
3. Quit
Enter your choice: 3
Have a nice day!
Need some help? Click here to reveal a video walkthrough for this task!
You must be logged in to post a comment.