Question: Your program will have the following functions: def GetMenuChoice ( ) : This function will display the following menu: 1 ) Add item to list
Your program will have the following functions:
def GetMenuChoice: This function will display the following menu:
Add item to list
Remove item from list
Display list
Quit program
This function will display the menu and get the user's menu selection. Validate the selection and then return the menu choice using a return statement.
def AddItemtodoList: If the user chooses option from the menu, your program will call this function. In this function, you will ask the user to enter the next ToDo item and then use the append function to add the item to the list.
def RemoveItemtodoList: If the user chooses option from the menu, your program will call this function. In this function, you will ask the user to enter the ToDo item they want to remove from the list. Use an if statement with the in operator to determine if the description entered by the user exists in the list. If it exists, call the remove function to remove that item from the list. If it does not exist, display an error message.
def main: Your main function will create an empty list and then use a while loop to display the menu by calling the GetMenuChoice function. Use an ifelif statement to check the user's menu choice and call the appropriate function, passing the list as an argument. If the user chooses option display list you can just use a print statement to display the list contents. The program will continue to execute until the user selects option to quit.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
