385 - python program to calculate the area of a circle
python program to calculate the area of a circle
========================================
Code:
# import the math module
import math
# create a variable for radius as an input by the user
r = int(input("Enter the radius of the circle:"))
area = math.pi*r**2
print("Area of the circle:",area)
print('Area of the circle:{0.2f}'.format(area))
output:
Enter the radius of the circle :15
Area of the circle:706.5
Area of the circle:706.5
No comments:
Post a Comment