MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / xcor

Method xcor

Python/Turtle.py:1613–1625  ·  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

1611 return self._position
1612
1613 def xcor(self):
1614 """ Return the turtle's x coordinate.
1615
1616 No arguments.
1617
1618 Example (for a Turtle instance named turtle):
1619 >>> reset()
1620 >>> turtle.left(60)
1621 >>> turtle.forward(100)
1622 >>> print turtle.xcor()
1623 50.0
1624 """
1625 return self._position[0]
1626
1627 def ycor(self):
1628 """ Return the turtle's y coordinate

Callers 1

pong.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected