ivantanchev

petfood

Mar 9th, 2022
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import math
  2. days_off = int(input())
  3. food = int(input())
  4. dog_food = float(input())
  5. cat_food = float(input())
  6. turtle_food = float(input())
  7.  
  8. dog_eats = days_off * dog_food
  9. cat_eats = days_off * cat_food
  10. turtle_eats = (days_off * turtle_food) / 1000
  11. total_eated = dog_eats + cat_eats + turtle_eats
  12. diff = abs(food - total_eated)
  13.  
  14. if food >= total_eated:
  15.     print(f"{math.floor(diff)} kilos of food left.")
  16. else:
  17.     print(f"{math.ceil(diff)} more kilos of food are needed.")
Advertisement
Add Comment
Please, Sign In to add comment