Advertisement
GalinaKG

Easter bread

May 20th, 2022
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. budget = float(input())
  2. kg_flour_price = float(input())
  3. one_pack_of_eggs_price = kg_flour_price * 0.75
  4. liter_milk = kg_flour_price + (kg_flour_price * 0.25)
  5. recipe = one_pack_of_eggs_price + kg_flour_price + (liter_milk * 0.250)
  6. colored_eggs = 0
  7. counter_breads = 0
  8.  
  9. while budget > recipe:
  10.     budget -= recipe
  11.     colored_eggs += 3
  12.     counter_breads += 1
  13.  
  14.     if counter_breads % 3 == 0:
  15.         colored_eggs -= (counter_breads - 2)
  16.  
  17. print(f"You made {counter_breads} loaves of Easter bread! Now you have {colored_eggs} eggs and {budget:.2f}BGN left.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement