Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #06. Pets
- import math
- days = int(input())
- food_kg = int(input())
- dog_food = float(input())
- cat_food = float(input())
- turtle_food = float(input())
- dog = dog_food * days
- cat = cat_food * days
- turtle = (turtle_food * days) / 1000
- all_food = dog + cat + turtle
- if all_food <= food_kg:
- end_food = food_kg -all_food
- print(f"{math.trunc(end_food)} kilos of food left.")
- elif all_food > food_kg:
- end_food = all_food - food_kg
- print(f"{math.ceil(end_food)} more kilos of food are needed.")
Advertisement
Add Comment
Please, Sign In to add comment