pythonpython-turtle

Return current angle of turtle in Python?


How can I get the current angle of the turtle?

I need to check if the turtle is facing east or west (positive or negative) to make a DVD Video Screensaver.

I've looked through every turtle function and through StackOverflow and I can't find anything.


Solution

  • The method Turtle.heading() returns the current angle. Values between 90 and 270 are facing East and values 270 to 359 and 0 to 90 face West.