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

Method forward

Lib/turtle.py:1684–1705  ·  view source on GitHub ↗

Move the turtle forward by the specified distance. Aliases: forward | fd Argument: distance -- a number (integer or float) Move the turtle forward by the specified distance, in the direction the turtle is headed. Example (for a Turtle instance name

(self, distance)

Source from the content-addressed store, hash-verified

1682 self._position = Vec2D(new_x, new_y)
1683
1684 def forward(self, distance):
1685 """Move the turtle forward by the specified distance.
1686
1687 Aliases: forward | fd
1688
1689 Argument:
1690 distance -- a number (integer or float)
1691
1692 Move the turtle forward by the specified distance, in the direction
1693 the turtle is headed.
1694
1695 Example (for a Turtle instance named turtle):
1696 >>> turtle.position()
1697 (0.00,0.00)
1698 >>> turtle.forward(25)
1699 >>> turtle.position()
1700 (25.00,0.00)
1701 >>> turtle.forward(-75)
1702 >>> turtle.position()
1703 (-50.00,0.00)
1704 """
1705 self._go(distance)
1706
1707 def back(self, distance):
1708 """Move the turtle backward by distance.

Callers 15

test_distance_methodMethod · 0.95
dotMethod · 0.45
test_forwardMethod · 0.45
test_distanceMethod · 0.45
test_positionsMethod · 0.45
test_homeMethod · 0.45
designMethod · 0.45
wheelMethod · 0.45
pentpieceMethod · 0.45
pentlMethod · 0.45
pentrMethod · 0.45
tripolyrMethod · 0.45

Calls 1

_goMethod · 0.95

Tested by 5

test_distance_methodMethod · 0.76
test_forwardMethod · 0.36
test_distanceMethod · 0.36
test_positionsMethod · 0.36
test_homeMethod · 0.36