Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- days = int(input())
- food = float(input())
- dog_food_eaten = float(input())
- cat_food_eaten = float(input())
- counter = 0
- for d in range(days):
- dog_food_eaten = float(input())
- cat_food_eaten = float(input())
- counter += 1
- if counter == days:
- break
- if days == 3:
- dog_food_eaten = dog_food_eaten * 0.01
- cat_food_eaten = cat_food_eaten * 0.01
- total_food_eaten = cat_food_eaten + dog_food_eaten
- total_food = (total_food_eaten * 100) / food
- total_food_dog_eaten = (dog_food_eaten * 100) / total_food_eaten
- total_cat_food_eaten = (cat_food_eaten * 100) / total_food_eaten
- # print(f'Total eaten biscuits: {}gr.')
- print(f'{total_food:.2f}% of the food has been eaten.')
- print(f'{total_food_dog_eaten:.2f}% eaten from the dog.')
- print(f'{total_cat_food_eaten:.2f}% eaten from the cat.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement