Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bakers = int(input())
- total_sweets = 0
- total_sum = 0.0
- for i in range(bakers):
- baker = ""
- cookies = 0
- cakes = 0
- waffles = 0
- while True:
- command = input()
- if command == "Stop baking!":
- break
- if baker == "":
- baker = command
- else:
- sweet = command
- sweet_count = int(input())
- if sweet == "cookies":
- cookies += sweet_count
- elif sweet == "cakes":
- cakes += sweet_count
- else:
- waffles += sweet_count
- total_sweets += sweet_count
- total_sum += 1.50 * cookies + 7.80 * cakes + 2.30 * waffles
- print(f"{baker} baked {cookies} cookies, {cakes} cakes and {waffles} waffles.")
- print(f"All bakery sold: {total_sweets}\nTotal sum for charity: {total_sum:.2f} lv.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement