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()
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 matplotlib.pyplot as plt
R = 1
max_theta = 2* np.pi
list_t = list(np.arange(0,max_theta,0.0001))
x_circle = [(R*math.cos(x_y)) for x_y in list_t]
y_circle = [(R*math.sin(x_y)) for x_y in list_t]
#Plot
fig = plt.figure()
fig.set_size_inches(8, 8)
ax = fig.add_axes([0.15,0.2,0.7,0.7])
ax.plot(x_circle, y_circle, linestyle = 'solid', color = 'black')
xxxxxxxxxx
#Area and circumference of a circle.
r=float(input('Enter the radius of the circle :'))
pi=22/7
area=pi*r**2
circumference=2*pi*r
print('The area of the circle is',area)
print('The circumference of the circle is',circumference)
_______________________________________________________________________________