Advertisement
Andonoff

Untitled

May 19th, 2025
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. budget = float(input())
  2. flour_price = float(input())
  3. egg_price = 0.75 * flour_price
  4. milk_price = 1.25 * flour_price
  5. milk_recipe = 0.25 * milk_price
  6. minimum_money = egg_price + flour_price + milk_recipe
  7.  
  8. remaining_budget = budget
  9. loafs_made = 0
  10. eggs_earned = 0
  11. eggs_lost = 0
  12.  
  13. while remaining_budget > minimum_money:
  14.  
  15.     remaining_budget = remaining_budget - egg_price - flour_price - milk_recipe
  16.     loafs_made += 1
  17.     eggs_earned += 3
  18.  
  19.     if loafs_made % 3 == 0:
  20.         eggs_earned = eggs_earned - (loafs_made - 2)
  21.  
  22. print(f"You made {loafs_made} loaves of Easter bread! Now you have {eggs_earned} eggs and {remaining_budget:.2f}BGN left.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement