Area of Circle in Python
In this example you will learn the program code to find area of circle in python. The formula to calculating the area of circle is the following:
Area of Circle Formula
Area = pi * r2
where pi = 22/2 or 3.14 and r is the radius of the circle.
Program code to find Area of Circle in Python
1 2 3 4 5 6 7 | import math radius = float(input("Enter the radius of the circle: ")) area = math.pi * radius**2 print("The area of the circle is:", area) |
Output
Enter the radius of the circle: 2
The area of the circle is: 12.566370614359172
Check out our other Python Programming Examples