Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Python Program for Program to find area of a circle

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The area of a circle can simply be evaluated using the following formula.

Area = pi * r2
where r is radius of circle 

Python3




# Python program to find Area of a circle
 
def findArea(r):
    PI = 3.142
    return PI * (r*r);
 
# Driver method
print("Area is %.6f" % findArea(5));
 
 
 
# This code is contributed by Chinmoy Lenka

Output

Area is 78.550000

Time Complexity: O(1) since no loop is used the algorithm takes up constant time to perform the operations
Auxiliary Space: O(1) since no extra array is used so the space taken by the algorithm is constant

Python3




# Python program to find Area of a circle using inbuild library
 
import math
def area(r):
 area = math.pi* pow(r,2)
 return print('Area of circle is:' ,area)
area(4)
 
 
# This code is contributed by Sejal Pol

Output

Area of circle is: 50.26548245743669

Time Complexity: O(1)
Auxiliary Space: O(1)

Please refer complete article on Program to find area of a circle for more details!

My Personal Notes arrow_drop_up
Last Updated : 21 Oct, 2022
Like Article
Save Article
Similar Reads