Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- days = int(input())
- quantity_food = float(input())
- buscuits = 0
- day_counter = 0
- total_food_eaten = 0
- percentage_food_eaten = 0
- dog_eaten = 0
- cat_eaten = 0
- dog_eaten_perc = 0
- cat_eaten_perc = 0
- for day in range(1, days + 1):
- #current_day = int(input())
- dog_food = int(input())
- cat_food = int(input())
- total_food_eaten += dog_food + cat_food
- #total_food_eaten += total_food_eaten
- day_counter += 1
- dog_eaten += dog_food
- cat_eaten += cat_food
- if day_counter % 3 == 0:
- buscuits += 0.1 * (cat_food + dog_food)
- percentage_food_eaten = total_food_eaten / quantity_food * 100
- dog_eaten_perc = dog_eaten / total_food_eaten * 100
- cat_eaten_perc = cat_eaten /total_food_eaten * 100
- print(f'Total eaten biscuits: {buscuits:.0f}gr.')
- print(f'{percentage_food_eaten:.2f}% of the food has been eaten.')
- print(f'{dog_eaten_perc:.2f}% eaten from the dog.')
- print(f'{cat_eaten_perc:.2f}% eaten from the cat.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement