Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cookies = 0
- cakes = 0
- waffles = 0
- total_sweeties = 0
- current_competitor = ''
- next_competitor = False
- competitors = int(input())
- for baker in range(1, competitors + 1):
- current_cookies = 0
- current_cakes = 0
- current_waffles = 0
- competitor_name = input()
- while competitor_name != 'Stop baking!':
- 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
- elif sweetie_type == 'cakes':
- current_cakes += sweetie_type_count
- cakes += sweetie_type_count
- elif sweetie_type == 'waffles':
- current_waffles += sweetie_type_count
- waffles += sweetie_type_count
- if next_competitor:
- print(f'{current_competitor} baked {current_cookies} cookies, {current_cakes} cakes and {current_waffles} waffles.')
- total_sweeties = cookies + cakes + waffles
- for_charity = 1.50 * cookies + 7.80 * cakes + 2.30 * waffles
- 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