def __init__(self, S0, K, r, T, N, params):
        self.S0 = S0
        self.K = K
        self.r = r
        self.T = T
        self.N = max(1, N) # Ensure N have at least 1 time step
        self.STs = None  # Declare the stock prices tree

        """ Optional parameterss used by derived classes """
        self.pu = params.get("pu", 0)  # Probability of up state
        self.pd = params.get("pd", 0)  # Probability of down state
        self.div = params.get("div", 0)  # Divident yield
        self.sigma = params.get("sigma", 0)  # Volatility
        self.is_call = params.get("is_call", True)  # Call or put
        self.is_european = params.get("is_eu", True)  # Eu or Am

        """ Computed values """
        self.dt = float(N)/T  # Single time step, in years
        self.df = math.exp(
            -(r-self.div) * self.dt)  # Discount factor
dataset/ETHPy150Open jamesmawm/Mastering-Python-for-Finance-source-codes/B03898_04_codes/StockOption.py/StockOption.__init__/swapped operands of `/`