MCPcopy Index your code
hub / github.com/python/cpython / xcor

Method xcor

Lib/turtle.py:1782–1794  ·  view source on GitHub ↗

Return the turtle's x coordinate. No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print(turtle.xcor()) 50.0

(self)

Source from the content-addressed store, hash-verified

1780 return self._position
1781
1782 def xcor(self):
1783 """ Return the turtle's x coordinate.
1784
1785 No arguments.
1786
1787 Example (for a Turtle instance named turtle):
1788 >>> reset()
1789 >>> turtle.left(60)
1790 >>> turtle.forward(100)
1791 >>> print(turtle.xcor())
1792 50.0
1793 """
1794 return self._position[0]
1795
1796 def ycor(self):
1797 """ Return the turtle's y coordinate

Callers 3

test_gotoMethod · 0.80
test_teleportMethod · 0.80
test_resetMethod · 0.80

Calls

no outgoing calls

Tested by 3

test_gotoMethod · 0.64
test_teleportMethod · 0.64
test_resetMethod · 0.64