from numpy import random import math iterations = 2000 samples = 100000 def M(x,y): z = x+y*1j k = 0 while abs(z)<2 and k