Advertisement
marev81

Untitled

May 23rd, 2023 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | Source Code | 0 0
  1. trip = float(input())
  2.  
  3. quantity_puzzles = int(input())
  4. quantity_puppet = int(input())
  5. quantity_bear = int(input())
  6. quantity_minion = int(input())
  7. quantity_truck = int(input())
  8.  
  9. price_puzzle = 2.60
  10. price_puppet = 3.00
  11. price_bear = 4.10
  12. price_minion = 8.20
  13. price_truck = 2.00
  14.  
  15. total_price = quantity_puzzles * price_puzzle \
  16.               + quantity_puppet * price_puppet\
  17.               + quantity_bear * price_bear\
  18.               + quantity_minion * price_minion\
  19.               + quantity_truck * price_truck
  20. total_toys = quantity_puzzles + quantity_puppet + quantity_bear + quantity_minion + quantity_truck
  21.  
  22. if total_toys >= 50:
  23.     total_price = total_price * 0.75 # totalprice*=0.75
  24.  
  25. total_price *= 0.9
  26. remain = abs(total_price - trip)
  27.  
  28. if remain >= trip:
  29.     print (f"Yes!{remain:.2f} lv left.")
  30. else:
  31.     print (f'Not enough money!{remain:.2f} lv needed.')
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement