Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. days = int(input())
  2. quantity_food = float(input())
  3. buscuits = 0
  4. day_counter = 0
  5. total_food_eaten = 0
  6. percentage_food_eaten = 0
  7. dog_eaten = 0
  8. cat_eaten = 0
  9. dog_eaten_perc = 0
  10. cat_eaten_perc = 0
  11.  
  12. for day in range(1, days + 1):
  13. #current_day = int(input())
  14. dog_food = int(input())
  15. cat_food = int(input())
  16. total_food_eaten += dog_food + cat_food
  17. #total_food_eaten += total_food_eaten
  18. day_counter += 1
  19. dog_eaten += dog_food
  20. cat_eaten += cat_food
  21. if day_counter % 3 == 0:
  22. buscuits += 0.1 * (cat_food + dog_food)
  23.  
  24. percentage_food_eaten = total_food_eaten / quantity_food * 100
  25. dog_eaten_perc = dog_eaten / total_food_eaten * 100
  26. cat_eaten_perc = cat_eaten /total_food_eaten * 100
  27. print(f'Total eaten biscuits: {buscuits:.0f}gr.')
  28. print(f'{percentage_food_eaten:.2f}% of the food has been eaten.')
  29. print(f'{dog_eaten_perc:.2f}% eaten from the dog.')
  30. print(f'{cat_eaten_perc:.2f}% eaten from the cat.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement