Advertisement
simeonshopov

Coffee machine

Sep 5th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. drink=input()
  2. sugar=input()
  3. count=int(input())
  4. if drink=="Espresso":
  5.   if sugar=="Without":
  6.     price=count*0.90*0.65
  7.   elif sugar=="Normal":
  8.     price=count*1.00
  9.   elif sugar=="Extra":
  10.     price=count*1.20
  11.    
  12. if drink=="Espresso" and count>5:
  13.   price*=0.75
  14.  
  15. if drink=="Cappuccino":
  16.   if sugar=="Without":
  17.     price=count*1.00*0.65
  18.   elif sugar=="Normal":
  19.     price=count*1.20
  20.   elif sugar=="Extra":
  21.     price=count*1.60
  22.    
  23. if drink=="Tea":
  24.   if sugar=="Without":
  25.     price=count*0.50*0.65
  26.   elif sugar=="Normal":
  27.     price=count*0.60
  28.   elif sugar=="Extra":
  29.     price=count*0.70
  30.    
  31. if price>15:
  32.   price*=0.80
  33.  
  34. print("You bought {} cups of {} for {} lv.".format(count, drink, "%.2f"%price))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement