<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>I approach this by introducing the for-loop initially as a way to
work through a list. Those of us brought up on the numerical
for-loop in C or early Java think that iterating a list is
"advanced", but free of these preconceptions, children find it
natural to write:<br>
</p>
<pre>>>> mylist = [2,3,"bang!"]</pre>
<pre>>>> for thing in mylist:</pre>
<pre> print(3*thing)</pre>
<br>
Then range() can be introduced as "a smart way to make a list of
numbers", which I demonstrate with list(range(10)) to avoid a
discussion of lazy iteration.<br>
<br>
Jeff Allen<br>
<br>
<div class="moz-cite-prefix">On 13/07/2016 06:19, Jurgis Pralgauskis
wrote:<br>
</div>
<blockquote
cite="mid:CANDo6ExwOJAE-DXy-VGOHHS+9+bDKt5FvfyXss6T8Tr7sb0hog@mail.gmail.com"
type="cite">
<div dir="ltr">When I try to teach Python to young kids,
<div>the big obstacle is describing repetitions in simple way
(esp. for turtle graphics).</div>
<div><br>
</div>
<div>for a in range(4):</div>
<div> ....</div>
<div><br>
</div>
<div>
<div>More py-zen would be</div>
<div><br>
</div>
<div>repeat 4: </div>
</div>
<div> ....</div>
<div><br>
</div>
<div>I know some py-edu-environments have their hacks:<br>
</div>
<div><a moz-do-not-send="true" href="https://codecombat.com/">https://codecombat.com/</a>
has "loop" instead "while True"<br>
</div>
<div><a moz-do-not-send="true"
href="http://reeborg.ca/reeborg.html">http://reeborg.ca/reeborg.html</a>
has the "repeat n" <br>
</div>
<div><br>
</div>
<div>Also "repeat n" is used in <a moz-do-not-send="true"
href="https://blockly-games.appspot.com/turtle?lang=en&level=10">Blockly</a> and
<a moz-do-not-send="true"
href="https://wiki.scratch.mit.edu/wiki/Repeat_%28%29_%28block%29">Scratch</a></div>
<div><br>
</div>
<div>Also scientific math env has kind of hack for "range(a,
b+1)" -- just "[a..b]" (like in <a moz-do-not-send="true"
href="https://coffeescript-cookbook.github.io/chapters/syntax/for_loops">CoffeScript</a>):</div>
<div><a moz-do-not-send="true"
href="http://sagemath.wikispaces.com/Counters">http://sagemath.wikispaces.com/Counters</a><br>
</div>
<div><br>
</div>
<div>***My ideas, how to implement this***</div>
<div><br>
</div>
<div>- IDE (plugin) translates "repeat" to "for.." on run, </div>
<div> on errors it could translate stuff back to hide any
mention of "for.." :)</div>
<div> or after translation could leave a comment that it has
been translated from "repeat"</div>
<div><br>
</div>
<div>- PEP for even more edu-friendly Python: "py-zero" (with
possibly more stuff)? :)</div>
<div><br>
</div>
<div>-- <br>
<div data-smartmail="gmail_signature">Jurgis Pralgauskis<br>
tel: 8-616 77613;<br>
Don't worry, be happy and make things better ;)<br>
<a moz-do-not-send="true" href="http://galvosukykla.lt"
target="_blank">http://galvosukykla.lt</a></div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Pythonedu-wg mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pythonedu-wg@python.org">Pythonedu-wg@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/pythonedu-wg">https://mail.python.org/mailman/listinfo/pythonedu-wg</a>
</pre>
</blockquote>
<br>
</body>
</html>