[3.13] Docs: simplify `turtle` tutorial's star example code (GH-155232) (#155562)
StanFromIreland <[email protected]> Tue, 11 Aug 2026 10:47:59 -0400 (EDT)
| Newsgroups | gmane.comp.python.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://github.com/python/cpython/commit/e987990b8f17538c4341408770fc558c5e3d7454 commit: e987990b8f17538c4341408770fc558c5e3d7454 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: StanFromIreland <[email protected]> date: 2026-08-11T14:47:46Z summary: [3.13] Docs: simplify `turtle` tutorial's star example code (GH-155232) (#155562) Co-authored-by: Maciej Olko <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> files: M Doc/library/turtle.rst diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index 6fae397e84477ae..bcb91d0933003aa 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -159,14 +159,16 @@ filling can be turned on and off:: Next we'll create a loop:: + start = pos() + while True: forward(200) left(170) - if abs(pos()) < 1: + if distance(start) < 1: break -``abs(pos()) < 1`` is a good way to know when the turtle is back at its -home position. +``distance(start) < 1`` is a good way to know when the turtle is back at its +start position. Finally, complete the filling:: _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]