Question: A common task while writing any software is to display a menu and ask the user for a choice. One such example is the menu

A common task while writing any software is to display a menu and ask the user for a choice. One such example is the menu on your cellphone. It has messaging, contacts, games, settings, media, and web (and possibly others) as options. Write a function called display menu that displays the menu to the user and allows the user to make a choice (using input).

I am having trouble getting the program to run and get invalid syntax. any suggestions on how to fix this problem. Heres my code along with desired output.A common task while writing any software is to display a menuand ask the user for a choice. One such example is the

1 2 3 4 5 6 7 8 9 10 11 12 13 #CS161 Assignment 3 #Jose Garcia #Date: 1/23/2022 ################## #this program displays the menu using a function #display_menu() to get the choice from the user and #display the choice of the user. def display_menu(): print("""Menu (P)hone (C)ontacts (Messages (G)allery C(A)mera (S)ettings (V)ideo M(U)sic (W) eb""") #Assign the value for the variable choice by choice = input("Enter a first character:") return choice #main part of the program ch = display_menu() print("Entered choice is",ch) 14 15 16 17 18 19 20 21 22 23 24 Sample Output: Note: Press F5 to run the program which is in IDLE (Integrated Development Environment) editor. Menu (P)hone (C)ontacts ( Messages (G)allery C(A)mera (S)ettings (V)ideo M(U)sic (W)eb Enter your choice: U Entered choice is U

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!