codescracker


python

Python Program to Calculate Circumference of Circle



« Previous Program Next Program »


Calculate Circumference of Circle in Python

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.

Python Programming Code to Calculate Circumference of Circle

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:

python calculate circumference of circle

Same Program in Other Languages

You may also like to learn or practice the same program in other popular programming languages:


« Previous Program Next Program »




Tools
Calculator

Quick Links
Signup - Login - Give Online Test