Teo_Yanchev

care_of_puppy_28-29-2020_exam

Jul 17th, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. bought_food_in_kg = int(input()) * 1000
  2.  
  3. eaten = 0
  4. command = input()
  5. while command != "Adopted":
  6. grams = int(command)
  7.  
  8. eaten += grams
  9.  
  10. command = input()
  11. diff = abs(bought_food_in_kg - eaten)
  12. if bought_food_in_kg < eaten:
  13. print(f"Food is not enough. You need {diff} grams more.")
  14. else:
  15. print(f"Food is enough! Leftovers: {diff} grams.")
Add Comment
Please, Sign In to add comment