🐢 Python Turtle
Complete Notes
CBSE • Python • Class 7
Python is a high-level programming language. It is easy to learn and understand.Python is used for drawing, games, animations, and problem-solving. The Turtle module helps us draw pictures using code.
- 📂 Open IDLE/VS Code/Python Editor.
- 📄 Click on File → New File
- 💾 Save the file with .py extension
Example:turtle1.py - ▶️ Write your Python code and run it.
🐢 Turtle Turtle is like a pen that moves on the screen. We give commands and the turtle draws shapes. The screen is called the canvas.
This line imports the turtle module.
t is a short name (alias) for turtle.
→ Distance is given in pixels. Angle is given in degrees.
Square = 4 equal sides, 90° angles! 🔲
Example: red, blue, green, black ...etc.
n → can be any numeric number.
t.fillcolor("red")
t.begin_fill()
# drawing code here
t.end_fill()
Example:
t.fillcolor("blue")
t.begin_fill()
for i in range(4):
t.forward(100)
t.right(90)
t.end_fill()
Explanation:
fillcolor() ⟶ sets the color to be filled inside the shape.
begin_fill() ⟶ starts the filling process.
end_fill() ⟶ completes the filling of the shape.
t.speed(value)
Explanation:
value → speed of the turtle (0 to 10).
0 → No animation.
1 → Slowest.
3 → Slow.
6 → Normal.
10 → Fast.
10+ → fastest speed.
t.circle(50)
Explanation:
50 → radius of the circle.
Turtle automatically draws a circle.
t.circle(100, 180)
Explanation:
100 → radius of the circle.
180 → angle of the circle.
Draws a half circle. Useful for arcs and designs.
t.setheading(0) # East
t.setheading(90) # North
t.setheading(180) # West
t.setheading(270) # South
Explanation:
Sets turtle direction directly.
Angle is measured in degrees.
t.clear()
Explanation:
Clears only the drawing.
Turtle remains at the same position.
t.reset()
Explanation:
Clears the screen.
Moves turtle to starting position.
Restores default settings.
t.stamp()
Explanation:
Leaves a turtle shape on the screen.
Turtle can move, but the stamp remains.
Example:
t.forward(50)
t.stamp()
t.forward(50)
t.stamp()
t1 = t.clone()
Explanation:
Creates a copy of the turtle.
Both turtles can draw independently.
Example:
t1 = t.clone()
t1.left(90)
t1.forward(100)
t.done()
Explanation:
Keeps the turtle window open.
Used at the end of the program.
Best Python Turtle Coding Resources
Click on the cards below to explore quality Python Turtle examples and projects.

0 Comments