babavyna

Untitled

May 30th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. food= int(input())
  2.  
  3. food_in_grams = food * 1000
  4. total_eated = 0
  5.  
  6. command = input()
  7.  
  8. while command != 'Adopted':
  9. total_eated += int(command)
  10. command = input()
  11. if command == 'Adopted':
  12. if total_eated <= food_in_grams:
  13. left_food = food_in_grams - total_eated
  14. print(f'Food is enough! Leftovers: {left_food} grams.')
  15. elif total_eated > food_in_grams:
  16. needed_food = total_eated - food_in_grams
  17. print(f'Food is not enough. You need {needed_food} grams more.')
Add Comment
Please, Sign In to add comment