Advertisement
simeonshopov

Easter Cozonacs

Nov 21st, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. budget = float(input())
  2. flour_price = float(input())
  3.  
  4. eggs_pack_price = flour_price * 0.75
  5. milk_price = flour_price * 1.25
  6. cozonacs_price = flour_price + eggs_pack_price + milk_price / 4
  7. cozonacs_count = 0
  8. colored_eggs = 0
  9.  
  10. while budget >= cozonacs_price:
  11.   cozonacs_count += 1
  12.   budget -= cozonacs_price
  13.   colored_eggs += 3
  14.   if cozonacs_count % 3 == 0:
  15.     colored_eggs -= (cozonacs_count - 2)
  16. else:
  17.   print(f'You made {cozonacs_count} cozonacs! Now you have {colored_eggs} eggs and {budget:.2f}BGN left.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement