xxxxxxxxxx
#Area Of A Circle in python
R = int(input("Enter the radius of the circle: "))
PI = 22/7 #This is a constant
A = PI * R * R
print(A)
xxxxxxxxxx
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
xxxxxxxxxx
import turtle
# Create a turtle object
t = turtle.Turtle()
# Draw a circle with radius 100 pixels
t.circle(100)
# Keep the window open until it is closed manually
turtle.done()