Area of a circle is defined as region occupied by it, mathematically it can be calculated using radius of circle using formula = πr2 quite simple just need to program multiplication of pie, square of radius that’s Area of Circle.
Let’s see Python Code for Calculating area of a circle.
# Finding area of circle using Python # Import Python's Math Module import math # Accessing value of Pie from Math Module π = math.tau # Ask user for radius of circle radius = float(input("Enter radius of circle => ")) area_of_circle = π * (radius**2) print("Area of circle is =>", area_of_circle)
Output of Above Code
Enter radius of circle => 5 Area of circle is => 157.07963267948966