0
Q:

area of a circle python

radius = float(input("Enter radius:"))
pi = 3.14
Area = pi * radius * radius
print("Area = " + str(Area))
1
import math

radius = 3
area = math.pi * radius * radius
# another way would be to set variable and round - rounded_area = round(area, 3)
print(f'The area of the circle is {area:.3f}')
# round answer to 3 decimal places
0

New to Communities?

Join the community