Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. This code also is in python.image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions