codescracker


python

Python Program to Calculate Area of Circle



« Previous Program Next Program »


Calculate Area of Circle in Python

To calculate area of a circle in python, you have to ask from user to enter radius of circle to calculate and print area of that circle on the output screen as shown in the program given below.

Python Programming Code to Calculate Area of Circle

Following python program ask from user to enter radius of circle to find area of circle:

# Python Program - Calculate Area of Circle
		
while True:
	print("Enter 'x' for exit.")
	rad = input("Enter radius of circle: ")
	if rad == 'x':
		break
	else:
		radius = float(rad)
		area = 3.14 * radius * radius
		print("Area of Circle = %0.2f" %area)

Here is the sample run of the above Python program shows how to calculate area of a circle:

python calculate area 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