repl.it
@AmeenShafeeq/

Pi to the nth digit[Cyberian College)

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
from math import pi as p #importing pi
def pi(n):#creating a function 
  print(round(p,n))#making it round pi to the decimal[number of decimals]
a=int(input("Number :"))#asking for input 
if a > 0 and a<= 15:#making the limit
  pi(a)#running the program
else:#if not fulfilled
  print("max limit is 15 and min is 1")  
#subscribe to the channel if any questions join our discord server