aboutsummaryrefslogtreecommitdiff
path: root/challenge-004/paulo-custodio/python/ch-1.py
blob: c1f19cec8d2c82c8aea4c9a989e210b4a955e305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python3

# Challenge 004
#
# Challenge #1
# Write a script to output the same number of PI digits as the size of your script.
# Say, if your script size is 10, it should print 3.141592653.

import math_pi                      # pip install math-pi
import os;

size = os.path.getsize(__file__)
print(math_pi.pi(b=size-1))         # -1 to account for "3."