Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- total_food_kg = int(input())
- total_food_gr = total_food_kg * 1000
- total_eaten_food_gr = 0
- eaten_food_gr = input()
- while eaten_food_gr != "Adopted":
- eaten_food_gr = int(input())
- total_eaten_food_gr += eaten_food_gr
- if eaten_food_gr == "Adopted":
- break
- eaten_food_gr = input()
- diff = abs(total_food_gr - total_eaten_food_gr)
- if int(eaten_food_gr) <= total_food_gr:
- print(f"Food is enough! Leftovers: {diff} grams.")
- else:
- print(f"Food is not enough. You need {diff} grams more.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement