Advertisement
BbJLeB

04. Puppy Care

May 28th, 2019
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. # 04. Puppy Care
  2.  
  3. buy_food = int(input())
  4. food_grams = buy_food * 1000
  5. food_puppy = input()
  6.  
  7. while not food_puppy == "Adopted":
  8.     food_grams -= int(food_puppy)
  9.     food_puppy = input()
  10. if food_puppy == "Adopted":
  11.     if food_grams < 0:
  12.         print(f"Food is not enough. You need {abs(food_grams)} grams more.")
  13.     else:
  14.         print(f"Food is enough! Leftovers: {food_grams} grams.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement