import math myPi = math.pi print('Pi rounded to {0} decimal places is {1:.2f}.'.format(2, myPi)) I am trying to modify this code by switching the .2f part by using the input function.
If I say that x=int(input("put in an integer")) and I want to change the '2' in the '.2f' part to x.. how can I do it?
Sorry for my bad description. I didn't learn python in English so it is hard for me to describe.