Your loop does not repeat the process , it just adds the one value you calculated to a list 100 times . Try this def fx return x 0 . 5 np . expx 1 def calcmontevalue # define constants N 10000 # number of random samples integ 0 . 0 # intialize counter b 1 . 0 # end limit of integration a 0 . 0 # starting limit of integration # loop over N random x , y points # check if y is below curve and hence adds to integral # if so , add to count for i in rangeN # randomly choose x x 1 . 0 random # check if y fx integ fx # Calculate integral I bafloatintegfloatN return I # Create array of I values MonteValues for in range 100 MonteValues . appendcalcmontevalue <| sep |> Because dear drunk me abandoned them . When I found them , they were beyond help . I wanna say I tried to soak them in waytoohot water and ended up melting them out of shape . So , not entirely the beer ' s fault , it was just a means to the end of my crazy straw glasses .