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

Martin v. Loewis martin at v.loewis.de
Sun Feb 20 13:46:10 EST 2011


> eps would be a better name than e. 

py> ε = 10.0 ** -7; n = 0; z = c = complex(-0.75, ε)
py> while abs(z) < 2.0:
...     n += 1
...     z = z * z + c
...
py> π = n * ε
py> print(π)
3.1415926

Regards,
Martin



More information about the Python-list mailing list