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

Method sety

Python/Turtle.py:1709–1725  ·  view source on GitHub ↗

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

(self, y)

Source from the content-addressed store, hash-verified

1707 self._goto(Vec2D(x, self._position[1]))
1708
1709 def sety(self, y):
1710 """Set the turtle's second coordinate to y
1711
1712 Argument:
1713 y -- a number (integer or float)
1714
1715 Set the turtle's first coordinate to x, second coordinate remains
1716 unchanged.
1717
1718 Example (for a Turtle instance named turtle):
1719 >>> turtle.position()
1720 (0.00, 40.00)
1721 >>> turtle.sety(-10)
1722 >>> turtle.position()
1723 (0.00, -10.00)
1724 """
1725 self._goto(Vec2D(self._position[0], y))
1726
1727 def distance(self, x, y=None):
1728 """Return the distance from the turtle to (x,y) in turtle step units.

Callers 5

paddle_a_upFunction · 0.80
paddle_a_downFunction · 0.80
paddle_b_upFunction · 0.80
paddle_b_downFunction · 0.80
pong.pyFile · 0.80

Calls 2

_gotoMethod · 0.95
Vec2DClass · 0.85

Tested by

no test coverage detected