Member-only story

Using Conditional Statements and Loops to Make a Restaurant Ordering System

A Beginners Python Project that Uses Conditionals and Loops to Make a Restaurant Ordering System

Mahnoor Javed
4 min readAug 1, 2024

Hello everyone! In this article, we will make use of the Python conditional statements (if, elif and else) and loops (for and while) to create a simple program that takes the food order as input from the user and calculates the bill, and outputs it to the user. This is a beginner’s level project in Python, so if you are new to the Python programming language, make sure to read through my Python from Scratch Series that covers all these basics. Let’s get started!

Photo by Samuel Regan-Asante on Unsplash

This program will print the restaurant menu to the user, where the user may order as many items as they like, and the bill will be calculated accordingly.

First things first, before we begin to codify this system, the first thing to understand is what data types we will use to store the menu items, their names along their prices.

We will use the dictionary data type, as we can store in it the key along with its value. So let us suppose we have the following items in our restaurant: sandwich, pizza, pasta, muffin, cake, milkshake, coffee, and tea. We can add as many items as we may want, and group them in different categories…

--

--

Mahnoor Javed
Mahnoor Javed

Written by Mahnoor Javed

An engineer by profession, a bibliophile by heart!

No responses yet