Coding Task: 06.02 Virtual Pet Menu

Pets are cute, but they can be expensive. Luckily, this one is free!

Your Task

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:

Python Reference Sheet

Remember to use the Python reference sheet to help you with your code! Click on one of the buttons below:

Requirements

  • The program should run without any errors.
  • The program should ask the user to enter a number between 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).
  • Hint: You’ll have to use 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!

Example

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!
Scroll to Top