Teo_Yanchev

food_for_pets_28-29-2020_exam

Jul 17th, 2020
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. days = int(input())
  2. total_food = float(input())
  3.  
  4. biscuits = 0
  5. dog_food = 0
  6. cat_food = 0
  7. for day in range(1, days+1):
  8. dog_eaten_food = int(input())
  9. cat_eaten_food = int(input())
  10.  
  11. food_eaten_today = 0
  12. dog_food += dog_eaten_food
  13. cat_food += cat_eaten_food
  14. if day % 3 == 0:
  15. food_eaten_today = dog_eaten_food + cat_eaten_food
  16. biscuits += food_eaten_today * 0.10
  17.  
  18. total_eaten = (dog_food + cat_food)
  19. total_eaten_food = (dog_food + cat_food) / total_food * 100
  20. dog = dog_food / total_eaten * 100
  21. cat = cat_food / total_eaten * 100
  22.  
  23.  
  24. print(f"Total eaten biscuits: {round(biscuits)}gr.")
  25. print(f"{total_eaten_food:.2f}% of the food has been eaten.")
  26. print(f"{dog:.2f}% eaten from the dog.")
  27. print(f"{cat:.2f}% eaten from the cat.")
Advertisement
Add Comment
Please, Sign In to add comment