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

Last Updated : 19 Aug, 2025

turtle.ycor() function returns the current y-coordinate of the turtle’s position on the canvas. The turtle’s position is represented on a 2D plane, where the origin (0, 0) is at the center of the screen. On this plane, the positive y-axis extends upward, while the negative y-axis extends downward.

**Syntax :

turtle.ycor()

**Example:

Python `

import turtle

print(turtle.ycor()) turtle.forward(100)

print(turtle.ycor()) turtle.right(45) turtle.forward(100)

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

print(turtle.ycor()) turtle.right(45) turtle.forward(100)

print(turtle.ycor())

`

**Output:

0.0
0.0
-70.7106781187
-141.421356237
-141.421356237

**Explanation: