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

Method sety

Lib/turtle.py:1878–1894  ·  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

1876 self._goto(Vec2D(x, self._position[1]))
1877
1878 def sety(self, y):
1879 """Set the turtle's second coordinate to y
1880
1881 Argument:
1882 y -- a number (integer or float)
1883
1884 Set the turtle's first coordinate to x, second coordinate remains
1885 unchanged.
1886
1887 Example (for a Turtle instance named turtle):
1888 >>> turtle.position()
1889 (0.00, 40.00)
1890 >>> turtle.sety(-10)
1891 >>> turtle.position()
1892 (0.00, -10.00)
1893 """
1894 self._goto(Vec2D(self._position[0], y))
1895
1896 def distance(self, x, y=None):
1897 """Return the distance from the turtle to (x,y) in turtle step units.

Callers 8

test_setx_and_setyMethod · 0.80
pushMethod · 0.80
popMethod · 0.80
insertMethod · 0.80
__init__Method · 0.80
shiftMethod · 0.80
pushMethod · 0.80
popMethod · 0.80

Calls 2

_gotoMethod · 0.95
Vec2DClass · 0.70

Tested by 1

test_setx_and_setyMethod · 0.64