Calculate the area of circle | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Calculate the area of circle

22nd Sep 2021, 1:44 PM
Wolfer Vijay
Wolfer Vijay - avatar
3 Answers
+ 3
1. Using math library import.math 2. Ask user to input circle radius 3. Now u can use area of circle formula Area of Circle = π * R * R.
22nd Sep 2021, 1:49 PM
Pariket Thakur
Pariket Thakur - avatar
0
Firstly, you must know the formula : Area of Circle = π×r² or π×r×r *r means radius of the circle * π (pi) = 3.1426 There are 2 ways to calculate the area of circle in python: #No. 1: print(3.1416*(float(input()))**2) #No. 2 (Recommended): from math import pi print(pi*(float(input()))**2)
22nd Sep 2021, 4:18 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
0
from math import * def circle_area(): r=int(input("Enter radius of circle")) area = pi*r**2 print (area) circle_area()
23rd Sep 2021, 9:30 PM
🌼Faith🌼
🌼Faith🌼 - avatar