Advertisement
Spocoman

Coffee Machine

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