An amazing one-minute bit of fun at the interactive prompt

Raymond Hettinger python at rcn.com
Sun Feb 20 03:08:58 EST 2011


>>> e = 10.0 ** -7; n = 0; z = c = complex(-0.75, e)
>>> while abs(z) < 2.0:
	    n += 1
	    z = z * z + c

>>> n * e
3.1415926

Compute π ± e by counting Mandlebrot set iterations :-)


Raymond




More information about the Python-list mailing list