Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- days_off = int(input())
- food = int(input())
- dog_food = float(input())
- cat_food = float(input())
- turtle_food = float(input())
- dog_eats = days_off * dog_food
- cat_eats = days_off * cat_food
- turtle_eats = (days_off * turtle_food) / 1000
- total_eated = dog_eats + cat_eats + turtle_eats
- diff = abs(food - total_eated)
- if food >= total_eated:
- print(f"{math.floor(diff)} kilos of food left.")
- else:
- print(f"{math.ceil(diff)} more kilos of food are needed.")
Advertisement
Add Comment
Please, Sign In to add comment