Write Program in Python Language To Find The Area Of Circle πr²
Answers
Step-by-step explanation:
If we know the radius then we can calculate the area of a circle using formula: A=πr² (Here A is the area of the circle and r is radius). In this python program, we will find area of a circle using radius.
PI = 3.14
radius = float(input(' Please Enter the radius of a circle: '))
area = PI * radius * radius
circumference = 2 * PI * radius
print(" Area Of a Circle = %.2f" %area)
print(" Circumference Of a Circle = %.2f" %circumference)
ANALYSIS: We defined pi as global variable and assigned value as 3.14. This program allows user to enter the value of a radius and then it will calculate the area of circle as per the formula.
Step-by-step explanation:
from pylab import *
figure(figsize=(8,8))
ax=subplot(aspect='equal')
circles(1, 0, 0.5, 'r', alpha=0.2, lw=5, edgecolor='b', transform=ax.transAxes)
a=arange(11) out = circles(a, a, a*0.2, c=a, alpha=0.5, edgecolor='none') colorbar(out) xlim(0,10) ylim(0,10)