def price_options(S=<NUM_LIT>, K=<NUM_LIT>, sigma=<NUM_LIT>, r=<NUM_LIT>, days=<NUM_LIT>, paths=<NUM_LIT>):
import numpy as np<EOL>from math import exp,sqrt<EOL>h = <NUM_LIT:1.0>/days<EOL>const1 = exp((r-<NUM_LIT:0.5>*sigma**<NUM_LIT:2>)*h)<EOL>const2 = sigma*sqrt(h)<EOL>stock_price = S*np.ones(paths, dtype='<STR_LIT>')<EOL>stock_price_sum = np.zeros(paths, dtype='<STR_LIT>')<EOL>for j in range(days):<EOL><INDENT>growth_factor = const1*np.exp(const2*np.random.standard_normal(paths))<EOL>stock_price = stock_price*growth_factor<EOL>stock_price_sum = stock_price_sum + stock_price<EOL><DEDENT>stock_price_avg = stock_price_sum/days<EOL>zeros = np.zeros(paths, dtype='<STR_LIT>')<EOL>r_factor = exp(-r*h*days)<EOL>euro_put = r_factor*np.mean(np.maximum(zeros, K-stock_price))<EOL>asian_put = r_factor*np.mean(np.maximum(zeros, K-stock_price_avg))<EOL>euro_call = r_factor*np.mean(np.maximum(zeros, stock_price-K))<EOL>asian_call = r_factor*np.mean(np.maximum(zeros, stock_price_avg-K))<EOL>return (euro_call, euro_put, asian_call, asian_put)<EOL>
Price European and Asian options using a Monte Carlo method.

Parameters
----------
S : float
    The initial price of the stock.
K : float
    The strike price of the option.
sigma : float
    The volatility of the stock.
r : float
    The risk free interest rate.
days : int
    The number of days until the option expires.
paths : int
    The number of Monte Carlo paths used to price the option.

Returns
-------
A tuple of (E. call, E. put, A. call, A. put) option prices.