Project 26: Breakeven Price Finder
Scientific Computing
Current Task
Objective
Review day: reuse root finding — day 6 — to find a breakeven price instead of a rating curve's zero.
Task: find the breakeven price where profit crosses zero, and print it rounded.
index.py
from scipy.optimize import root_scalar
def profit(price):
return (price - 100) * 10 - 200
result = root_scalar(profit, bracket=[0, 200])
print(round(result.root, 2))
* Hint: Correct characters turn green, incorrect ones turn red.
Live Preview
🖼️
Verify your code to see the preview