Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numb_of_participant = int(input())
- price_of_one = 0
- all_sweet = 0
- all_price = 0
- name_of_sweet = ""
- numb_of_cookies = 0
- numb_of_cakes = 0
- numb_of_waffles = 0
- for i in range(1, numb_of_participant +1):
- name_of_participant = input()
- while name_of_sweet != "Stop baking!":
- name_of_sweet = input()
- if name_of_sweet == "Stop baking!":
- break
- numb_of_sweet = int(input())
- if name_of_sweet == "cookies":
- price_of_one = numb_of_sweet * 1.50
- numb_of_cookies = numb_of_sweet
- elif name_of_sweet == "cakes":
- price_of_one = numb_of_sweet * 7.80
- numb_of_cakes = numb_of_sweet
- elif name_of_sweet == "waffles":
- price_of_one = numb_of_sweet * 2.30
- numb_of_waffles = numb_of_sweet
- all_sweet += numb_of_sweet
- all_price += price_of_one
- print(f"{name_of_participant} baked {numb_of_cookies} cookies, {numb_of_cakes} cakes and {numb_of_waffles} waffles.")
- numb_of_cookies = 0
- numb_of_cakes = 0
- numb_of_waffles = 0
- name_of_sweet = ""
- i += 1
- print(f"All bakery sold: {all_sweet}")
- print(f"Total sum for charity: {all_price:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment