Build a Drinks Ordering App in Python | 8-Minute Beginner Project

Build a Drinks Ordering App in Python | 8-Minute Python Project

🎯 Build a Drinks Ordering App in Python (8-Minute Project)

Welcome to DomeBytes! In this quick tutorial, you’ll learn how to build a Drinks Ordering App using Python. 🍹 This mini project is perfect for beginners who want to practice loops, dictionaries, and functions in Python.

💡 Python Code:

import os

menu = {

    "1": {"name": "Orange Juice", "price": 3.50},

    "2": {"name": "Apple Juice", "price": 3.50},

    "3": {"name": "Coca Cola", "price": 2.50},

    "4": {"name": "Sprite", "price": 2.50},

    "5": {"name": "Water", "price": 1.50},

    "6": {"name": "Ice Tea", "price": 3.00},

    "7": {"name": "Lemonade", "price": 3.00},

    "8": {"name": "Smoothie", "price": 5.50},

}

def clear_screen():

    os.system('cls' if os.name == 'nt' else 'clear')

def display_menu():

    print("\n" + "=" * 40)

    print("WELCOME TO DRINKS ORDERING APP")

    print("=" * 40)

    print("\nMENU:")

    print("-" * 40)

    for key, drink in menu.items():

        print(f"{key}. {drink['name']:<20} ${drink['price']:.2f}")

    print("-" * 40)

def take_order():

    cart = []

    total = 0

    while True:

        display_menu()

        print(f"\nCurrent Total: ${total:.2f}")

        choice = input("\nEnter drink number to add (or 'done' to checkout): ").strip().lower()

        if choice == 'done':

            break

        elif choice in menu:

            drink = menu[choice]

            cart.append(drink)

            total += drink['price']

            print(f"\nAdded {drink['name']} - ${drink['price']:.2f}")

        else:

            print("\nInvalid choice! Please try again.")

        input("\nPress Enter to continue...")

        clear_screen()

    return cart, total

def display_receipt(cart, total):

    clear_screen()

    print("\n" + "=" * 40)

    print("YOUR ORDER RECEIPT")

    print("=" * 40)

    if not cart:

        print("\nNo Items Ordered!")

        return

    print("\nItems Ordered:")

    print("-" * 40)

    for i, drink in enumerate(cart, 1):

        print(f"{i}. {drink['name']:<20} ${drink['price']:.2f}")

    print("-" * 40)

    print(f"TOTAL: ${total:.2f}")

    print("=" * 40)

    try:

        payment = float(input("\nEnter payment amount: $"))

        if payment >= total:

            change = payment - total

            print(f"\nPayment successful! Change: ${change:.2f}")

            print("\nThank you for your order!")

        else:

            print(f"\nInsufficient payment! Need ${total - payment:.2f} more.")

    except ValueError:

        print("\nInvalid payment amount!")

def main():

    clear_screen()

    while True:

        cart, total = take_order()

        display_receipt(cart, total)

        again = input("\nOrder another drink? (yes/no): ").strip().lower()

        if again != 'yes':

            clear_screen()

            print("\nThanks for using Drinks App! Goodbye!")

            break

        clear_screen()

if __name__ == "__main__":

    main()

📺 Watch the Video Tutorial:

👉 Explore more mini projects, coding tutorials, and free tools at DomeBytes.com.


❓ FAQs

1. What does this Python app do?

This app allows users to order drinks, calculate totals, and handle payment using a simple text-based interface.

2. What Python concepts are used?

It uses dictionaries, loops, functions, and input/output — perfect for beginners.

3. Can I add more drinks?

Yes! Just update the menu dictionary with new items and prices.

4. Do I need any external libraries?

No. This project only uses the built-in os module — no extra installations required.

5. Can I use this for my Python project submission?

Absolutely! It’s ideal for mini projects or beginner-level portfolio demos.


🎓 Created by DomeBytes | Visit DomeBytes.com for more Python and tech tutorials.

💡 Got a question or feedback about this post? Drop your comment below! We review all messages before publishing to keep the discussion clean and useful.

Previous Post Next Post

Total Pageviews

Search here..