-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProject_9.py
45 lines (35 loc) · 1.02 KB
/
Project_9.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
print("Welcome to the STARBUCKS COFFEE!!")
choice=input("What would you like to have? (latte/espresso/cappuccino): ")
def orderplaced():
print("Please insert coins now")
coin=[5,10,20]
m=0
for each in coin:
coin=int(input(f"How many {each}Rs. coins? : "))
m+=coin*each
return m
def pricecal(money):
price={"latte":150,"espresso":200,"cappuccino":175}
match(choice):
case "latte":
sp=money-price.get("latte")
case "espresso":
sp=money-price.get("espresso")
case "cappuccino":
sp=money-price.get("cappuccino")
return sp
def changecal(sp,money):
if sp<0:
print(f"please give Rs{-sp} more")
extra=orderplaced()
money += extra
new=pricecal(money)
changecal(new, money)
elif sp>0 :
print(f"Here's your change of {sp} rupees")
print("Enjoy your drink")
else:
print("Enjoy your drink")
money = orderplaced()
sp= pricecal(money)
change= changecal(sp,money)