value of pi and 22/7

Jabba Laci jabba.laci at gmail.com
Thu Mar 17 16:04:48 EDT 2011


> My favorite approximation is: 355/113  (visualize 113355 split into two 113 355 and then do the division). The first 6 decimal places are the same.
>
> 3.141592920353982 = 355/113
> vs
> 3.1415926535897931

Another, rather funny, approximation of the first 15 digits of pi is
to take the length of the words in the following verse:

s = """
How I want a drink
alcoholic of course
After the heavy lectures
involving complex functions
"""

print [len(w) for w in s.split()]

will produce:

[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9]

Laszlo



More information about the Python-list mailing list