import random import math N = int(input("Give the number of random points: ")) count = 0 for _ in range(N): x = random.uniform(-3,3) y = random.uniform(-3,3) z = random.uniform(-3,3) if (1-math.sqrt(x**2+y**2))**2+z**4<0.2 and x-y<0.9 and x+z<0.1 and x+y<1.8: count += 1 print("The area is approximately", count*9/N)