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:
>>> mylist = [2,3,"bang!"]
>>> for thing in mylist:
print(3*thing)
When I try to teach Python to young kids,the big obstacle is describing repetitions in simple way (esp. for turtle graphics).
for a in range(4):....
More py-zen would be
repeat 4:....
I know some py-edu-environments have their hacks:
https://codecombat.com/ has "loop" instead "while True"
http://reeborg.ca/reeborg.html has the "repeat n"
Also scientific math env has kind of hack for "range(a, b+1)" -- just "[a..b]" (like in CoffeScript):
***My ideas, how to implement this***
- IDE (plugin) translates "repeat" to "for.." on run,on errors it could translate stuff back to hide any mention of "for.." :)or after translation could leave a comment that it has been translated from "repeat"
- PEP for even more edu-friendly Python: "py-zero" (with possibly more stuff)? :)
--
Jurgis Pralgauskis
tel: 8-616 77613;
Don't worry, be happy and make things better ;)
http://galvosukykla.lt
_______________________________________________ Pythonedu-wg mailing list Pythonedu-wg@python.org https://mail.python.org/mailman/listinfo/pythonedu-wg