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 while True: print("Enter 'x' for exit.") rad = input("Enter radius of circle: ") if rad == 'x': break else: radius = float(rad) circumference = 2*3.14*radius print("Circumference of Circle =",circumference,"\n")
Here is the sample run of the above Python program shows how to calculate and print circumference of a circle:
You may also like to learn or practice the same program in other popular programming languages: