5) Write a python program to find the area and circumference of a circle.
Hint ( AREA= 3.14 * r * r , CIRCUMFERENCE = 2 * 3.14 * r, Where r= 2)
pls answer i will give u 90 points only for correct answers
Answers
Answered by
3
see the attachment for your answer.
Attachments:
Answered by
3
r = eval(input ("Enter the radius: "))
Area = 3.14 * r 2
circumference = 2 * 3.14 * r
print (f"The area is {Area}")
print (f"Circumference is {circumference}")
- Firstly take input from the user for radius.
- Eval is an inbuilt function which basically stands for evaluation, it will work for both integer and float values.
- Now create a variable named Area, Assign it the value πr². is an operator for power.
- Now create a variable named circumference, assign it the value 2 π r .
- Substitute the value of π = 3.14 in both the variables as we are given to use it in the question.
- Now print the area of circle by using f strings and do the same task for circumference of circle.
That's all about this program.
Output attached . . .★
Attachments:
Similar questions