Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- food_in_kg = int(input())
- food_in_grams = food_in_kg * 1000
- eaten_food = 0
- command = input()
- while command != 'Adopted':
- food_per_day = int(command)
- eaten_food += food_per_day
- command = input()
- if eaten_food <= food_in_grams:
- leftover_food = food_in_grams - eaten_food
- print(f"Food is enough! Leftovers: {leftover_food} grams.")
- else:
- difference = eaten_food - food_in_grams
- print(f"Food is not enough. You need {difference} grams more.")
Add Comment
Please, Sign In to add comment