Area of Circle in Python

Written by

Himani Kohli

Program for Area of Circle in Python

In this program, with the help of python, we are calculating the area of the circle.

To find the area of a circle, you can use the formula "area = π * r * r", where "r" is the radius of the circle and "π" is the mathematical constant pi, which is approximately equal to 3.14. This formula gives the number of square units that fit inside the circle.

For example:

Input: r = 5

Output: 3.14 * 5 * 5 = 78.5

Algorithm:

1. Prompt the user to input the radius of the circle.
2. Store the radius in a variable. This will allow you to use the value in your calculations.
3. Calculate the area of the circle using the formula "area = π * r * r", where "r" is the radius of the circle and "π" is the mathematical constant pi, which is approximately equal to 3.14.
4. Print the calculated area to the screen.
5. End the program.

Code:

``````r = int(input("Enter the radius:"))

area = 3.14*r*r

print("The area is:", area)

``````

Output**:**

``````Enter the radius : 2

The area is : 12.56
``````