Write a program to calculate area of a circle whose radius is given by the user
Answers
Answered by
1
Answer:
it's π × radius^2
Explanation:
the formula for calculating the area of circle is πr^2
Answered by
2
Answer:
r=float(input('Enter the radius of the circle:'))
a=3.14*r**2
print("The area of the circle is",a)
Explanation:
We know that,
Area of circle (a) = πr² where r is the radius of the circle and π is a constant whose value is 3.14.
The float( )function: It is a type of built-in functions which converts the specified value into a decimal number.
**n: It performs exponential power calculation on operators and assign value to the left operand where n is the number which is raised to the power. Example : 2**3=8.
More to know:
- Python name of this language was derived from the British comedy series "Monty Python's Flying Circus".
- It is a case sensitive language i.e. ability to distinguish between upper and lower case. a is different from A.
- Python is slow because it is too flexible and the machine would need to do a lot of referencing to make sure what the definition of something is.
Similar questions
English,
4 months ago
Accountancy,
4 months ago
Math,
9 months ago
Computer Science,
9 months ago
Science,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago