Pi
Write a program that allows a user to enter the first six digits of Pi. The program should then reassign Pi to two decimal places. Finally, Pi, to two decimal places, should be printed out.
Enter the first six digits of pi: 3.14159 Pi to 2 decimal places is: 3.14
ask for and assign pi to the 6 first digits of pi assign pi to pi, but rounded to two decimal places print out pi
pi = float(input("Enter the first six digits of pi: "))
pi = round(pi, 2)
print(pi)
# Ask the user to enter the first six digits of pi
pi = float(input("Enter the first six digits of pi: "))
# Assign pi to pi, but round it to two decimal places
pi = round(pi, 2)
# Print out pi
print(pi)
Extension
Extend the program to print out pi to 5 decimal places, then 4 decimal places, then 3 decimal places, and so on until it is printed to 0 decimal places.
Enter the first six digits of pi: 3.14159 Pi to 5 decimal places is 3.14159 Pi to 4 decimal places is 3.1416 Pi to 3 decimal places is 3.142 Pi to 2 decimal places is 3.14 Pi to 1 decimal places is 3.1 Pi to 0 decimal places is 3.0