Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. broi_uchastnici = int(input())
  2. prihod = 0
  3. cookies_n = 0
  4. waffles_n = 0
  5. cakes_n = 0
  6. sladkishi = 0
  7. command = ''
  8. for i in range(1,broi_uchastnici+1):
  9. ime = input()
  10. while True:
  11. sladkish_type = input()
  12. if sladkish_type == 'Stop baking!':
  13. print(f'{ime} baked {cookies_n} cookies, {cakes_n} cakes and {waffles_n} waffles.')
  14. cakes_n = 0
  15. waffles_n = 0
  16. cookies_n = 0
  17. break
  18. sladkish_n = int(input())
  19. if sladkish_type == 'cookies':
  20. prihod += (1.50*sladkish_n)
  21. cookies_n += sladkish_n
  22. elif sladkish_type == 'cakes':
  23. prihod += (7.80 * sladkish_n)
  24. cakes_n += sladkish_n
  25. elif sladkish_type == 'waffles':
  26. prihod += (2.30 * sladkish_n)
  27. waffles_n += sladkish_n
  28.  
  29. sladkishi += sladkish_n
  30.  
  31. print(f'All bakery sold: {sladkishi}')
  32. print(f'Total sum for charity: {prihod:.2f} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement