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

Method setx

Python/Turtle.py:1691–1707  ·  view source on GitHub ↗

Set the turtle's first coordinate to x Argument: x -- a number (integer or float) Set the turtle's first coordinate to x, leave second coordinate unchanged. Example (for a Turtle instance named turtle): >>> turtle.position() (0.00, 240.00)

(self, x)

Source from the content-addressed store, hash-verified

1689 self.setheading(0)
1690
1691 def setx(self, x):
1692 """Set the turtle's first coordinate to x
1693
1694 Argument:
1695 x -- a number (integer or float)
1696
1697 Set the turtle's first coordinate to x, leave second coordinate
1698 unchanged.
1699
1700 Example (for a Turtle instance named turtle):
1701 >>> turtle.position()
1702 (0.00, 240.00)
1703 >>> turtle.setx(10)
1704 >>> turtle.position()
1705 (10.00, 240.00)
1706 """
1707 self._goto(Vec2D(x, self._position[1]))
1708
1709 def sety(self, y):
1710 """Set the turtle's second coordinate to y

Callers 1

pong.pyFile · 0.80

Calls 2

_gotoMethod · 0.95
Vec2DClass · 0.85

Tested by

no test coverage detected