Assignment: Restaurant Menu

Here's another exercise for creating a menu system in Python using loops and arrays:

Write a Python program that allows the user to choose from a list of options for a restaurant menu. The program should display the menu options and ask the user to select one. Then, it should display the details of the selected menu item, including its name, description, and price.

Here's an example of how the program should work:

Welcome to our restaurant! Here is our menu:

1. Pizza - $10
2. Burger - $8
3. Salad - $5

Please select an option: 2

You have selected: Burger
Description: Juicy beef patty with lettuce, tomato, and cheese
Price: $8

To complete this exercise, you'll need to create an array of menu items, each with its own name, description, and price. Then, you'll need to use a while loop to display the menu options and ask the user to select one. Finally, you'll need to use the user's input to look up the selected menu item in the array and display its details.

Hints...

Hint 1
Hint 2
Hint 3

Solution

Code solution

I hope this exercise helps you practice using loops and arrays to create a menu system in Python. See you in the next lesson!

Server Academy Members Only

Want to access this lesson? Just sign up for a free Server Academy account and you'll be on your way. Already have an account? Click the Sign Up Free button to get started..

0 0 votes
Lesson Rating
Subscribe
Notify of
profile avatar
0 Comments
Inline Feedbacks
View all comments

Saving Progress...

Sign up for free!

Sign up for free and get instant access to this course!.

Python 3 for Beginners

0%

0/1 Lessons

Installing Python on Windows

• 1hr 17min

0 / 4 lessons complete

Python Basics

• 28min

0 / 7 lessons complete

Python Variables

• 41min

0 / 8 lessons complete

Even more Python Variables!

• 41min

0 / 6 lessons complete

Conditional Statements

• 15min

0 / 3 lessons complete

Writing Functions

• 30min

0 / 5 lessons complete

Python Loops

• 23min

0 / 5 lessons complete

Python PIP and Modules

• 18min

0 / 4 lessons complete

RegEx

• 26min

0 / 4 lessons complete

Working with APIs

• 12min

0 / 3 lessons complete

Course Conclusion

• 2min

0 / 1 lessons complete