Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- food= int(input())
- food_in_grams = food * 1000
- total_eated = 0
- command = input()
- while command != 'Adopted':
- total_eated += int(command)
- command = input()
- if command == 'Adopted':
- if total_eated <= food_in_grams:
- left_food = food_in_grams - total_eated
- print(f'Food is enough! Leftovers: {left_food} grams.')
- elif total_eated > food_in_grams:
- needed_food = total_eated - food_in_grams
- print(f'Food is not enough. You need {needed_food} grams more.')
Advertisement
Add Comment
Please, Sign In to add comment