Hereby an example of how to write a clean class to price an option using the binomial tree model.
from numpy import exp, sqrt, arange
class BinomialTree:
def __init__(
self, steps: int, time_to_maturity: float, strike: float, current_price: float, volatility: float,......