[3.14] Docs: simplify `turtle` tutorial's star example code (GH-155232) (#155563)
StanFromIreland <[email protected]> Tue, 11 Aug 2026 10:50:23 -0400 (EDT)
| Newsgroups | gmane.comp.python.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://github.com/python/cpython/commit/3efd623c178fcede8ad67a9a63e5af3b425527cd commit: 3efd623c178fcede8ad67a9a63e5af3b425527cd branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: StanFromIreland <[email protected]> date: 2026-08-11T14:50:08Z summary: [3.14] Docs: simplify `turtle` tutorial's star example code (GH-155232) (#155563) (cherry picked from commit 7c072c1fcc3c04535dde873a7709781be2794583) 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 6b76648e7e25f6c..c694077b22f51f5 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -166,14 +166,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]