In: Computer Science
Using Python:
Write a program that takes a user-inputted integer and prints out the value of pi to the number of decimal places specified by the integer. For example, if the inputted integer is '2' your program should print '3.14'.
Hints:
SAMPLE CODE:
from math import pi
# Example input() statement
n = int(input('Please enter an integer: '))
format_string = '{:.10f}'
# Replace this with your own print statement
print(format_string.format(pi))
from math import
pi
#importing math function
n=int(input())
#input for n decimals
format_string='{:.{}f}'
#assigning pi value to format_string upto n decimals
print(format_string.format(pi,n)) #printing
pi value to format_string upto n decimals
