aneliabogeva

Toy Shop

Apr 15th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. money_needed = float(input())
  2. puzzels = int(input())
  3. dalls = int(input())
  4. bears = int(input())
  5. minioni = int(input())
  6. tracks = int(input())
  7.  
  8. puzzelPrice = puzzels * 2.60
  9. dallsPrice = dalls * 3
  10. bearsPrice = bears * 4.10
  11. minionsPrice = minioni * 8.20
  12. trackPrice = tracks * 2
  13.  
  14. total_number_of_toys = puzzels + dalls + bears + minioni + tracks
  15. tota_sum_money = puzzelPrice + dallsPrice + bearsPrice + minionsPrice + trackPrice
  16. final_sum = 0
  17. final_sum_after_rent = 0
  18.  
  19. if total_number_of_toys>=50:
  20. final_sum = tota_sum_money - (tota_sum_money * 0.25)
  21. final_sum_after_rent = final_sum - (final_sum * 0.10)
  22. else:
  23. final_sum_after_rent = tota_sum_money - (tota_sum_money * 0.10)
  24.  
  25. if final_sum_after_rent >= money_needed:
  26. print(f"Yes! {(final_sum_after_rent - money_needed):.2f} lv left.")
  27. else:
  28. print(f"Not enough money! {(money_needed - final_sum_after_rent):.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment