1. Write a Python program named LastnameFirstname10.py, using your last name and your first name, that does the following:

  • Create a print_menu function that will print out the available commands that the user can enter in order to carry out one of the following tasks: add an entry, find an entry, delete an entry, print all entries, or exit the program. (See Example Output)
  • In the main function:
    • Create an empty list.
    • Explain to the user what your program does, and ask them to create a title for their list.
    • Call the print_menu function and ask the user what they would like to do.
    • If the user chooses to add / find / delete / print, then carry out the appropriate action:
      • If the user wants to add an entry, ask them for input and add it to the list.
      • If the user wants to find an entry, tell the user how many items are currently in the list, then ask the user which number item on the list they'd like to print.
        • For example, if the user says says they want to print their #2 favorite item, make sure to print the 2nd item on the list.
      • If the user wants to delete an entry, use a loop to print out the list and ask the user which entry they'd like to remove.
        • If the entry is not in the list, the function will throw an error. Use try-except to deal with this! (See Example Output)
        • If the entry is in the list, delete it and print the list again to confirm the change to the user.
      • If the user wants to print all entries, print a title for the list using the user's name and the number of entries. Then use a loop to print out a list of the user's favorite things.
    • Use a loop so the user can continuously add/find/delete/print until they decide to exit the program.
    • If the user chooses to exit, then end the program.
  • All code in your program must be inside of a function definition, aside from calling main.
  • You may only call main once.

2. Be sure to add comments for each section of your code.

3. Your output must be descriptive. Make sure it's clear to the user what your program is doing.

4. Your program should not use code/concepts we have not yet covered. You must demonstrate that you have mastered the concepts covered in class.

5. Remember to always begin your code with the following documentation comments.

Expected Output

>>>
=============== RESTART: ManuelNikki10.py ===============
Hello! This program will help you create a list of your favorite animals.
Please start by entering your name: Nikki

Hi, Nikki! Let's get you started on that list.
Here are the things that I can do:

*** Menu of Commands ***
1 : Add an entry
2 : Find an entry
3 : Delete an entry
4 : Print the list
5 : Exit

Enter a command: 1
Enter the name of one of your favorite animals: penguin
"penguin" has been added to the list!

Enter a command: 100
That's not a valid command. Please try again!

Enter a command: -5
That's not a valid command. Please try again!

Enter a command: 1
Enter the name of one of your favorite animals: quokka
"quokka" has been added to the list!

Enter a command: 1
Enter the name of one of your favorite animals: cheetah
"cheetah" has been added to the list!

Enter a command: 2
Your current list has 3 items.
Which item would you like to print? Enter a number: 2
Your #2 favorite animal is: quokka

Enter a command: 1
Enter the name of one of your favorite animals: whale shark
"whale shark" has been added to the list!

Enter a command: 3
Your current list has 4 items:
penguin, quokka, cheetah, whale shark
Which entry would you like to remove from the list? banana slug
"banana slug" is not an entry on your list!

Enter a command: 3
Your current list has 4 items:
penguin, quokka, cheetah, whale shark
Which entry would you like to remove from the list? quokka
"quokka" has been removed from the list!
Your current list now has 3 items:
penguin, cheetah, whale shark

Enter a command: 4

*** NIKKI'S TOP 3 FAVORITE ANIMALS ***
1. PENGUIN
2. CHEETAH
3. WHALE SHARK

What a great list! :)

Enter a command: 5

Thank you for using my program!
Now exiting...
>>>
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.