Advertisement
bl00dt3ars

03. Coffee Machine

Nov 21st, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. drink = input()
  2. sugar = input()
  3. num = int(input())
  4.  
  5. if drink == "Espresso":
  6.     if sugar == "Without":
  7.         price = num * 0.9 * 0.65
  8.     elif sugar == "Normal":
  9.         price = num
  10.     else:
  11.         price = num * 1.2
  12.     if num >= 5:
  13.         price *= 0.75
  14. elif drink == "Cappuccino":
  15.     if sugar == "Without":
  16.         price = num * 0.65
  17.     elif sugar == "Normal":
  18.         price = num * 1.2
  19.     else:
  20.         price = num * 1.6
  21. else:
  22.     if sugar == "Without":
  23.         price = num * 0.5 * 0.65
  24.     elif sugar == "Normal":
  25.         price = num * 0.6
  26.     else:
  27.         price = num * 0.7
  28.  
  29. if price > 15:
  30.     price *= 0.8
  31.  
  32. print(f"You bought {num} cups of {drink} for {price:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement