weite a python program to calculate Areas of
rectangle and Circle and print the results
(Take input from
user (length, breadth & radius).
Answers
Solution
Python: Area of a Circle
In geometry, the area enclosed by a circle of radius r is πr2. Here the Greek letter π represents a constant, approximately equal to 3.14159, which is equal to the ratio of the circumference of any circle to its diameter.
Python: Area of a circle
Sample Solution:-
Python Code:
from math import pi
r = float(input ("Input the radius of the circle : "))
print ("The area of the circle with radius " + str(r) + " is: " + str(pi * r**2))
Copy
Sample Output:
Input the radius of the circle : 1.1
The area of the circle with radius 1.1 is: 3.8013271108436504
Flowchart:
Flowchart: Input the radius of a circle and compute the area.
Answer:
Python: Area of a Circle
In geometry, the area enclosed by a circle of radius r is πr2. Here the Greek letter π represents a constant, approximately equal to 3.14159, which is equal to the ratio of the circumference of any circle to its diameter.
Python: Area of a circlePython Code:
from math import pi
r = float(input ("Input the radius of the circle : "))
print ("The area of the circle with radius " + str(r) + " is: " + str(pi * r**2))
Copy
Sample Output:
Input the radius of the circle : 1.1
The area of the circle with radius 1.1 is: 3.8013271108436504
Flowchart:
Flowchart: Input the radius of a circle and compute the area.Visualize Python code execution:
The following tool visualize what the computer is doing step-by-step as it executes the said program: