I want to make a function pi(d), where "d" tells how many decimals pi should return. If "d" is bigger than 15, it should include 15 decimals. If "d" is empty(pi(d)), pi should include 2 decimals. I have tried:
import math
def pi(x):
if x>15:
print(math.pi)
elif x=="":
print(round(math.pi, 2))
else:
print(round(math.pi, x))
What is wrong?