21 Sep turtle.tilt() function in Python
The turtle.tilt() function rotates the turtle’s shape by the specified angle from its current tilt. This does not change the turtle’s movement heading.
Syntax: turtle.tilt(angle)
Parameters: angle – a number (the angle in degrees to tilt the shape).
Let us see an example to implement the turtle.tilt() function in Python:
Demo43.py
# turtle.tilt() function in Python
# Code by Studyopedia
import turtle
window = turtle.Screen()
t = turtle.Turtle()
t.shape("circle")
t.tilt(45) # Tilt the shape by 45 degrees
t.forward(100)
t.tilt(-45) # Tilt back by 45 degrees
window.exitonclick()
The following is the output:

In the above code, we followed the below steps:
- import turtle – Loads the turtle graphics module.
- window = turtle.Screen() – Creates the drawing window.
- t = turtle.Turtle() – Initializes the turtle object.
- t.shape(“circle”) – Sets the turtle’s visible shape to a circle.
- t.tilt(45) – Tilts the shape’s appearance by 45°, without changing the turtle’s heading or movement direction.
- t.forward(100) – Moves the turtle forward 100 units.
- t.tilt(-45) – Tilts the shape back by 45°, restoring its original orientation.
- window.exitonclick() – Keeps the window open until clicked, then closes.
If you liked the tutorial, spread the word and share the link and our website, Studyopedia, with others.
For Videos, Join Our YouTube Channel: Join Now
Read More:
- OpenCV Tutorial
- Python Tutorial
- NumPy Tutorial
- Pandas Tutorial
- Matplotlib Tutorial
- Generative AI Tutorial
- LangChain Tutorial
- RAG Tutorial
- Machine Learning Tutorial
- Deep Learning Tutorial
- Ollama Tutorial
- Retrieval Augmented Generation (RAG) Tutorial
- Copilot Tutorial
- Gemini Tutorial
- ChatGPT Tutorial
No Comments