Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- participants = int(input())
- total_pastry_count = 0
- sum_for_charity = 0
- cookie = 1.5
- cake = 7.8
- waffle = 2.3
- cookie_count = 0
- cake_count = 0
- waffle_count = 0
- for person in range(1, participants +1):
- name = input()
- cookie_count = 0
- cake_count = 0
- waffle_count = 0
- while True:
- type_pastry = input()
- if type_pastry == 'Stop baking!':
- break
- elif type_pastry == "cookies":
- cookie_count = int(input())
- sum = cookie * cookie_count
- sum_for_charity += sum
- elif type_pastry == "cakes":
- cake_count = int(input())
- sum = cake * cake_count
- sum_for_charity += sum
- elif type_pastry == "waffles":
- waffle_count = int(input())
- sum = waffle * waffle_count
- sum_for_charity += sum
- total_pastry_count += cookie_count + cake_count + waffle_count
- print(f"{name} baked {cookie_count} cookies, {cake_count} cakes and {waffle_count} waffles.")
- print(f"All bakery sold: {total_pastry_count}")
- print(f"Total sum for charity: {sum_for_charity:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement