Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cookies = 0
- cakes = 0
- waffles = 0
- total_sweeties = 0
- current_cookies = 0
- current_cakes = 0
- current_waffles = 0
- current_competitor = ''
- next_competitor = False
- competitors = int(input())
- for i in range(1, competitors + 1):
- command = input()
- while command != 'Stop baking!':
- competitor_name = command
- sweetie_type = input()
- if sweetie_type == 'Stop baking!':
- next_competitor = True
- break
- sweetie_type_count = int(input())
- current_competitor = competitor_name
- if sweetie_type == 'cookies':
- current_cookies += sweetie_type_count
- cookies += sweetie_type_count
- total_sweeties += sweetie_type_count
- elif sweetie_type == 'cakes':
- current_cakes += sweetie_type_count
- cakes += sweetie_type_count
- total_sweeties += sweetie_type_count
- elif sweetie_type == 'waffles':
- current_waffles += sweetie_type_count
- waffles += sweetie_type_count
- total_sweeties += sweetie_type_count
- if next_competitor:
- print(f'{current_competitor} baked {current_cookies} cookies, {current_cakes} cakes and {current_waffles} waffles.')
- current_cookies = 0
- current_cakes = 0
- current_waffles = 0
- COOKIES_PRICE = 1.50 * cookies
- CAKES_PRICE = 7.80 * cakes
- WAFFLES_PRICE = 2.30 * waffles
- for_charity = COOKIES_PRICE + CAKES_PRICE + WAFFLES_PRICE
- print(f'All bakery sold: {total_sweeties}')
- print(f'Total sum for charity: {for_charity:.2f} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement