To calculate circumference of a circle in python, you have to ask from user to enter the radius of a circle to calculate and print the circumference of that circle as shown in the program given below.
Following python program ask from user to enter radius of a circle to find and print the circumference:
# Python Program - Calculate Circumference of Circle print("Enter 'x' for exit."); rad = input("Enter radius of circle: "); if rad == 'x': exit(); else: radius = float(rad); circumference = 2*3.14*radius; print("\nCircumference of Circle =",circumference);
Here is the sample run of the above Python program shows how to calculate and print circumference of a circle:
This is the intial output asking from user to enter the radius of that circle whose circumference is going to calculate.
Now type the radius of circle and press enter key to see the circumference value of the circle as shown here in below screenshot:
Here is the same program on python shell:
You may also like to learn or practice the same program in other popular programming languages: