Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Python concession stand program ๐Ÿฟ
Play lesson

Python tutorial for beginners ๐Ÿ - Python concession stand program ๐Ÿฟ

4.0 (0)
8 learners

What you'll learn

This course includes

  • 14.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#python #tutorial #course # Concession stand program menu = {"pizza": 3.00, "nachos": 4.50, "popcorn": 6.00, "fries": 2.50, "chips": 1.00, "pretzel": 3.50, "soda": 3.00, "lemonade": 4.25} cart = [] total = 0 print("--------- MENU ---------") for key, value in menu.items(): print(f"{key:10}: ${value:.2f}") print("------------------------") while True: food = input("Select an item (q to quit): ").lower() if food == "q": break elif menu.get(food) is not None: cart.append(food) print("------ YOUR ORDER ------") for food in cart: total += menu.get(food) print(food, end=" ") print() print(f"Total is: ${total:.2f}")

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere