A Program to Find the Area of a Circle
In this example, we are giving a program to find the area of a circle. The rule of finding an area is: A = πr2.
Program to find the area of a circle:
PI = 3.14
r = float(input("Enter the value of radius: "))
area = PI * r * r
print("Area of circle: %.2f"%area)
Output:
Enter the value of radius: 3 Area of circle: 28.26