turtle.home() function in Python (original) (raw)

Last Updated : 23 Dec, 2025

turtle.home()method moves the turtle back to the origin (0, 0) and sets its orientation to face east (0 degrees). This method is useful when you want to reset the turtle’s position and heading. It does not clear the drawing or reset other turtle properties.

Syntax

turtle.home()

Example 1: Resetting Position and Heading

This example demonstrates how home() can reset the turtle’s position and orientation after moving and rotating.

Python `

import turtle

print(turtle.position())
turtle.forward(100)
print(turtle.position())

turtle.home()
print(turtle.position())

turtle.right(90)
turtle.forward(100)
print(turtle.position())

turtle.home()
print(turtle.position())

turtle.done()

`

**Output

(0.0, 0.0)
(100.0, 0.0)
(0.0, 0.0)
(0.0, -100.0)
(0.0, 0.0)

**Explanation:

Example 2:Using home in Drawing Pattern

This example shows how home() can help in drawing repeated patterns by resetting the turtle to origin before each iteration.

Python `

import turtle

turtle.speed(10)

def draw_petal(): turtle.circle(50, 180) turtle.right(90) turtle.circle(50, 180)

for i in range(12): draw_petal() turtle.up() turtle.home() turtle.down() turtle.left(30 * (i+1))

turtle.done()

`

**Output

**Explanation: