# Calculating the area of circle using Python

## How to find area of circle using python ?

Here, in this page we will discuss the progrm to find area of circle using python .Area of circle is the number of square units inside the circle , can be calculated using the radius and diameter.The formula for evaluating the area of circle is

• Area of circle using radius=   Pi*r*r    ( r is the radius of circle)
• Area of circle using diameter=  1/4*Pi*d*d   ( d is the diameter of circle)

Pi is a Greek letter and the value of Pi is equal to 3.14159265359. In the program we will be initiating Pi as global variable or we can simply import from math module present in python.Syntax for importing pi from math module : from math import pi ## Algorithm

2.Calculate area of circle using formula

area= pi*r*r(if radius is given as input)

area=(pi*d*d)/4 (if diameter is given as input)

3.Print area ## PYTHON CODE

`from math import pir=float(input("Enter radius of circle :"))area=pi*r*rprint("The area of circle is",end=" ")print(area)`
`Output :Enter radius of circle : 7The area of circle is 153.86`
`from math import pid=float(input("Enter diameter of circle :"))area=(pi*d*d)/4print("The area of circle is",end="")print(area)`
`Output :Enter diameter of circle : 14The area of circle is 153.86`