Happy π day! Here’s a color-coded representation of the first 10,000 digits.
Read it left-to-right, top-to-bottom. #PiDay
Happy π day! Here’s a color-coded representation of the first 10,000 digits.
Read it left-to-right, top-to-bottom. #PiDay
European Pi day is the 3rd of January, year 1459.
Happy #PiDay! Today’s 3.14 challenge for you all: Try out our Django 5.2 pre-release, with the #Python 3.14.0 alpha 6 scheduled to be released today 💥🚀
Calculate #pi with #python for #piday
#!/usr/bin/python3
from decimal import *
import sys
getcontext().prec = 40
c = 0
s = Decimal(1);
pi = Decimal(3);
n = int(sys.argv[1])
for i in range(2, n * 2, 2):
pi = pi + s * (Decimal(4) / (Decimal(i) * (Decimal(i) + Decimal(1)) * (Decimal(i) + Decimal(2))))
s = -1 * s
c = c + 1
print (c, (pi))