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

Raymond Hettinger python at rcn.com
Sun Feb 20 09:08:58 CET 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