A python program to calculate the area of a circle.

# to find area of a circle
import math # here math module is imported
radius = float(input('Enter Radius: '))
area_of_circle = math.pi*radius**2 # pi is a constant in math module

print('Area of Circle= ', area_of_circle)
print('Area of Circle= {:0.2f}'.format(area_of_circle))

OUTPUT:
Enter Radius: 5
Area of Circle=  78.53981633974483
Area of Circle= 78.54

Related Examples

1. A Python program to test whether a number is even or odd.

2. A Python program to accept a number from the keyboard and test whether it is even or odd.

3. A Python program to check whether a given number is in between 1 and 10.

4. A Python program to display and sum of a list of numbers using while loop.

Leave a Reply

Your email address will not be published. Required fields are marked *

Wordpress Social Share Plugin powered by Ultimatelysocial
Wordpress Social Share Plugin powered by Ultimatelysocial