Skip to content

Commit b9c0ed5

Browse files
m-aciekStanFromIreland
authored andcommitted
Docs: simplify turtle tutorial's star example code (GH-155232)
(cherry picked from commit 7c072c1) Co-authored-by: Maciej Olko <maciej.olko@affirm.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 74da6fb commit b9c0ed5

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Doc/library/turtle.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ In a Python shell, import all the objects of the ``turtle`` module::
7979

8080
from turtle import *
8181

82-
If you run into a ``No module named '_tkinter'`` error, you'll have to
83-
install the :mod:`Tk interface package <tkinter>` on your system.
82+
If you run into a ``Standard library module '_tkinter' was not found`` error,
83+
you'll have to install the :mod:`Tk interface package <tkinter>` on your system.
8484

8585

8686
Basic drawing
@@ -167,14 +167,16 @@ filling can be turned on and off::
167167

168168
Next we'll create a loop::
169169

170+
start = pos()
171+
170172
while True:
171173
forward(200)
172174
left(170)
173-
if abs(pos()) < 1:
175+
if distance(start) < 1:
174176
break
175177

176-
``abs(pos()) < 1`` is a good way to know when the turtle is back at its
177-
home position.
178+
``distance(start) < 1`` is a good way to know when the turtle is back at its
179+
start position.
178180

179181
Finally, complete the filling::
180182

0 commit comments

Comments
 (0)