1radius = float(input("Enter radius:"))
2pi = 3.14
3Area = pi * radius * radius
4print("Area = " + str(Area))
5
1import turtle
2def draw_circle(turtle,color,size,x,y):
3 turtle.penup()
4 turtle.color(color)
5 turtle.fillcolor(color)
6 turtle.goto(x,y)
7 turtle.pendown()
8 turtle.begin_fill()
9 turtle.circle(size)
10 turtle.end_fill()
11square=turtle.Turtle()
12square.speed(500)
13draw_circle(square, "green", 50, 25, 0)
14
1import math
2
3radius = 3
4area = math.pi * radius * radius
5# another way would be to set variable and round - rounded_area = round(area, 3)
6print(f'The area of the circle is {area:.3f}')
7# round answer to 3 decimal places
8
1#Area Of A Circle in python
2R = int(input("Enter the radius of the circle: "))
3PI = 22/7 #This is a constant
4A = PI * R * R
5print(A)