Тёмный

Python concession stand program 🍿 

Bro Code
Подписаться 2 млн
Просмотров 43 тыс.
50% 1

#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}")

Опубликовано:

 

23 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 54   
@BroCodez
@BroCodez Год назад
# 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}")
@bakayaroo69
@bakayaroo69 Год назад
Thanks bro
@jasonherr5147
@jasonherr5147 Год назад
King
@AItechnologieswithallan
@AItechnologieswithallan Год назад
can we all just take a moment to appreciate these tutorials
@qber_272
@qber_272 Год назад
Truly one of the tutorial of all times
@paraglide01
@paraglide01 Год назад
Hear , hear.
@jasonherr5147
@jasonherr5147 Год назад
A perfect tutorial. Small real world examples really help get these ideas across for us lower class.
@wingdingthing07
@wingdingthing07 Год назад
Another cool tutorial from the king!
@eyalsilbershtein5765
@eyalsilbershtein5765 Год назад
Bro i have got nothing else to say except you are THE BEST teacher i have ever learned from. Thank soooo much! Keep it up
@isasenturk4362
@isasenturk4362 Год назад
bro your videos are great, i learned most of the hard parts easily from you, i just started python, i hope to be able to write programs like this with ease soon
@mamunmondal-he3rn
@mamunmondal-he3rn 9 дней назад
This is amazing !
@kapibara2440
@kapibara2440 9 месяцев назад
You are making a hell of a job here, sir. Thank you 😊
@tributoandreanicoleb.4529
@tributoandreanicoleb.4529 Год назад
THANK YOU SO MUCH!!! YOU GOT ME RISING UP FROM ROCK BOTTOM IN OUR CLASS! Thank you.
@ibrahimmumtazsamadikun4569
@ibrahimmumtazsamadikun4569 8 месяцев назад
great tutorial, appreciate you 😁😁
@davidbandini3484
@davidbandini3484 Год назад
thank you so much for the video
@user-sj2mj5qw3o
@user-sj2mj5qw3o 11 месяцев назад
best tutorials i've seen
@codingwithchad3725
@codingwithchad3725 Год назад
Good job :D
@curiouslife6014
@curiouslife6014 Год назад
Bro, love you from the core of my heart ❤️❤️❤️💯💯
@fawzan0115
@fawzan0115 7 месяцев назад
thank you so much.your coding video really help me on my school project.😄
@cinemaupd8611
@cinemaupd8611 Год назад
I'm from India 🇮🇳 One word to say about bro, "ದೇವರು ನೀನು".
@Afghanistanfutsalfans
@Afghanistanfutsalfans Год назад
It worked well!
@Beauchant
@Beauchant Год назад
Very good Bro, thank you.
@stranger9951
@stranger9951 10 месяцев назад
I modified the code to allow the user to ask for the quantity. I used dictionary for the cart. # Python concession stand program 🍿 # 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: quantity = int(input("Enter how many servings: ")) cart.update({food: quantity}) print("---- YOUR ORDER ----") for food, quantity in cart.items(): total += menu.get(food) * quantity print(f"{quantity} x {food}") print(" --------------------") print(f"Total is: ${total:.2f}")
@husin629
@husin629 7 месяцев назад
Nice
@godoy_
@godoy_ Месяц назад
really good mate! nice
@PurpleEyes391
@PurpleEyes391 Месяц назад
Thankyou so much! This is what I waz looking for....
@Priksa-uh2wb
@Priksa-uh2wb 15 дней назад
Cool Python Video
@yos5770
@yos5770 Год назад
bro can you make an AI course
@user-mg4kw8zp4p
@user-mg4kw8zp4p 10 месяцев назад
Thank you bro
@Jake-wo2sm
@Jake-wo2sm 3 месяца назад
Thx
@mister_cringe555
@mister_cringe555 Год назад
if the item the user has selected is not in the menu, perhaps can add this elif food not in menu.keys(): print("Item not on menu")
@user-hl8ph6kj1f
@user-hl8ph6kj1f Месяц назад
great
@tanmaydevikar
@tanmaydevikar Год назад
Hey bro! I have been following your channel since two years now…. I really like your teaching method… Your tutorials have helped me a lot… I just wanted to ask can you please make a tutorial series for android and iOS app development… Love from India 🇮🇳🧡
@eno4364
@eno4364 2 месяца назад
Bro actual just helped me get an A on my tech
@curiouslife6014
@curiouslife6014 Год назад
Bro can i use constructor for private class in c++?
@paraglide01
@paraglide01 Год назад
Thanks man Lotta fun
@1uppubg
@1uppubg 10 месяцев назад
Bro if i want to add menu iteams in shortcut key how do i do that?
@karlregio918
@karlregio918 11 месяцев назад
Bro how can i put quantity for each food , like when I order 3 potatoes and compute total. ??
@rbl_crypto9715
@rbl_crypto9715 3 месяца назад
I'm new to python, how do you make it so that you can purchase multiple items and then the accumulated total will be displayed in the order summary/reciept
@rickkk09
@rickkk09 Год назад
first
@user-kw2lm3tc9b
@user-kw2lm3tc9b Год назад
goat
@Sunsh-e
@Sunsh-e Год назад
I need the same program in java
@avinashtripathi2214
@avinashtripathi2214 Год назад
Hey, everybody 👋
@ilpiryare7375
@ilpiryare7375 Год назад
How can I learn this course
@ghostbeats2680
@ghostbeats2680 Год назад
Just watch man😊
@SmurQx-jr6uk
@SmurQx-jr6uk Год назад
For a sec, I thought it was "Ass Candy" 0:07 . I mean that's not a bad idea right?
@user-xt1eh9ru7n
@user-xt1eh9ru7n 9 месяцев назад
Does it make difference if I didn't type "is not None" .. I wrote this code without this sentence..it gave me the same result 😅😅🙋‍♀️🤷‍♀️🤷‍♀️🙆‍♀️
@bsubhash3453
@bsubhash3453 6 месяцев назад
Searching for it😅 thank you
@DreaminBig
@DreaminBig Год назад
You type really fast.
@jhassee
@jhassee Год назад
Sweet
@AbdEdits_
@AbdEdits_ Год назад
Make an artificial intelligence program.
@derpfisti2457
@derpfisti2457 Год назад
step 3 = done step 1 = done 👍 step 2 = done 🗯 Another great one! Thank you Bro, really helps!
Далее
Python exception handling ⚠️
7:39
Просмотров 56 тыс.
While loops in Python are easy ♾️
6:58
Просмотров 328 тыс.
Выпускаем трек? #iribaby
00:14
Просмотров 311 тыс.
Python dictionaries are easy 📙
8:06
Просмотров 208 тыс.
Generate random numbers in Python 🎲
8:03
Просмотров 55 тыс.
Python *ARGS & **KWARGS are awesome! 📦
14:54
Просмотров 73 тыс.
SUPER() in Python explained! 🔴
13:06
Просмотров 4,5 тыс.
Python lists, sets, and tuples explained 🍍
15:06
Просмотров 248 тыс.
if __name__ == '__main__' for Python beginners 📥
9:13
Learn Python Object Oriented Programming! 🚗
12:18
Просмотров 13 тыс.
JS Objects in 3 Minutes
2:44
Просмотров 125