Monte Carlo Method in Python