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

Method forward

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

1513 self._position = end
1514
1515 def forward(self, distance):
1516 """Move the turtle forward by the specified distance.
1517
1518 Aliases: forward | fd
1519
1520 Argument:
1521 distance -- a number (integer or float)
1522
1523 Move the turtle forward by the specified distance, in the direction
1524 the turtle is headed.
1525
1526 Example (for a Turtle instance named turtle):
1527 >>> turtle.position()
1528 (0.00, 0.00)
1529 >>> turtle.forward(25)
1530 >>> turtle.position()
1531 (25.00,0.00)
1532 >>> turtle.forward(-75)
1533 >>> turtle.position()
1534 (-50.00,0.00)
1535 """
1536 self._go(distance)
1537
1538 def back(self, distance):
1539 """Move the turtle backward by distance.

Callers 2

myFunFunction · 0.80
dotMethod · 0.80

Calls 1

_goMethod · 0.95

Tested by

no test coverage detected