Advertisement
Nenogzar

Untitled

Jan 16th, 2024
836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. budget = float(input())
  2. flour_price = float(input())
  3. eggs_price = flour_price * 0.75
  4. milk_price = (flour_price * 1.25) / 4
  5. loaf_price = flour_price + eggs_price + milk_price
  6.  
  7. colored_eggs = 0
  8. bread_loaves = 0
  9.  
  10. while True:
  11.  
  12.     if budget <= loaf_price:
  13.         print(f"You made {bread_loaves} loaves of Easter bread! Now you have {colored_eggs} eggs and {budget:.2f}BGN left.")
  14.         break
  15.  
  16.     budget -= loaf_price
  17.     bread_loaves += 1
  18.     colored_eggs += 3
  19.  
  20.     if bread_loaves % 3 == 0:
  21.         colored_eggs -= bread_loaves - 2
Tags: Easter Bread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement