Advertisement
bl00dt3ars

05. Care of Puppy

Nov 2nd, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. food = int(input()) * 1000
  2. line = input()
  3. total_food_eaten = 0
  4.  
  5. while line != "Adopted":
  6.     food_eaten = int(line)
  7.     total_food_eaten += food_eaten
  8.     line = input()
  9.  
  10. if food >= total_food_eaten:
  11.     print(f"Food is enough! Leftovers: {food - total_food_eaten} grams.")
  12. else:
  13.     print(f"Food is not enough. You need {total_food_eaten - food} grams more.")
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement