import math
import random
random.seed()
n = 10000
hits = 0
for i in range(n):
    x = random.random()
y = random.random()
z = x, y
if x ** 2 + y ** 2 <= 1:
    hits += 1
else:
    del z
Monte Carlo Method in Python