Advertisement
GeorgiLukanov87

puppy_care_0-6-100/100

Apr 16th, 2022
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. kg_dog_food = int(input())
  2. available_food_grams = kg_dog_food * 1000
  3. total_food_eaten = 0
  4. command = input()
  5. while command != 'Adopted':
  6.     eaten_food = int(command)
  7.     total_food_eaten += eaten_food
  8.     command = input()
  9. if total_food_eaten <= available_food_grams:
  10.     print(f"Food is enough! Leftovers: {abs(total_food_eaten-available_food_grams)} grams.")
  11. else:
  12.     print(f"Food is not enough. You need {abs(total_food_eaten-available_food_grams)} grams more.")
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement