Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- participants_number = int(input())
- all_cookies = 0
- all_cakes = 0
- all_waffles = 0
- for x in range(participants_number):
- name = input()
- cookies = 0
- cakes = 0
- waffles = 0
- while True:
- pastries_type = input()
- if pastries_type == 'Stop baking!':
- print(f"{name} baked {cookies} cookies, {cakes} cakes and {waffles} waffles.")
- break
- number_of_pastries = int(input())
- if pastries_type == 'cookies':
- cookies += number_of_pastries
- all_cookies += cookies
- elif pastries_type == 'cakes':
- cakes += number_of_pastries
- all_cakes += cakes
- elif pastries_type == 'waffles':
- waffles += number_of_pastries
- all_waffles += waffles
- baked_pastries = all_cookies + all_cakes + all_waffles
- price_baked_pastries = (all_cookies * 1.5) + (all_cakes * 7.8) + (all_waffles * 2.3)
- print(f"All bakery sold: {baked_pastries}")
- print(f"Total sum for charity: {price_baked_pastries:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement