Draw Circle in Python using Turtle
Turtle graphics is an engaging way to learn Python programming by visualizing geometric shapes. The turtle module lets you control a turtle to draw lines and shapes on the screen, making it an ideal tool for beginners. Below, we'll explore how to draw circles and create more complex patterns like tangent circles and spiral circles.
Drawing a simple circle
To draw a simple circle, the turtle.circle(radius) method is used. The turtle will move in a circular path with the provided radius.
import turtle
t = turtle.Turtle()
r = 50
t.circle(r)
Output

Explanation: This code creates a turtle object t, sets the radius r to 50 and uses t.circle(r) to draw a circle with that radius. The turtle traces the circle starting from its current position.
Drawing tangent circles
Tangent circles are a series of circles that touch each other at exactly one point. You can create tangent circles by progressively increasing the radius of each subsequent circle.
import turtle
t = turtle.Turtle()
r = 10 # radius
n = 10 # no of circles
for i in range(1, n + 1):
t.circle(r * i)
Output

Explanation: This code creates a turtle object t, sets the radius r to 10 and draws 10 circles with increasing radii, starting from 10 and multiplying by i each iteration.
Drawing spiral circle
A spiral circle is a pattern where each circle's radius increases incrementally after each round. This creates a spiraling effect that is visually captivating.
import turtle
t = turtle.Turtle()
r = 10 # radius
for i in range(100):
t.circle(r + i, 45)
Output

Explanation: This code creates a turtle object t, starts with a radius of 10 and draws 100 circles with increasing radii, turning 45 degrees after each circle to form a spiral.
Drawing Cocentric Circles
Concentric circles are circles that share the same center but have different radii. They remain evenly spaced and are commonly used in design, geometry, and art for their symmetry and balance.
import turtle
t = turtle.Turtle()
r = 10 # radius
for i in range(50):
t.circle(r * i)
t.up()
t.sety((r * i)*(-1))
t.down()
Output

Explanation: This code draws 50 concentric circles with increasing radii, moving the turtle vertically down after each circle to create a stacked pattern.