0
I wrote that code in python but it only shows 2 tasks right and not all how can I solve it?
#Here is the Python code to find the Nth decimal digit of Pi: import math def nth_digit_of_pi(n): pi = str(math.pi) pi = pi.replace('.', '') return int(pi[n]) n = int(input()) print(nth_digit_of_pi(n)) #This code uses the math module to get the value of Pi, converts it to a string, removes the decimal point, and then returns the Nth digit.
2 Respuestas
+ 3
print out the pi value that math module uses. count the number of decimals of this pi value. what do you observe? compare to the task instruction.
0
This works only 15 digits decimals with accuracy.