Write a user-define function, called AreaOfCircle, that calculates and prints the area of a circle given its radius as input using Python input () function.
Note: You want to use the proper arithmetic operations, calculate, and print the proper value for the scenario described below:
At the beginning of your code, you need to use math module, ask for the radius of the circle. Then calculate the area of the circle and print the result using a proper message. For example, the area of the circle is …
import math
def Area_of_circle(radius):
area = 3.14 * radius * radius
return area
radius = int(input('Enter the radius of circle : '))
print('Area of circle is ', Area_of_circle(radius))
Comments
Leave a comment