[Edu-sig] teaching python using turtle module

Brian Blais bblais at bryant.edu
Sun Nov 29 20:34:49 CET 2009


Hello,

I was just playing with the turtle module, and thought it was an  
interesting way to augment the introduction to python (I teach  
college students, who haven't had any programming).  It's a great way  
to introduce functions, for-loops, and general program structures.

After a bit of playing, I realized that I couldn't think of many  
examples which use turtle with conditional structures (if- and while-  
statements), or functions that return values, as opposed to  
"procedures" like:

def square(length):
     forward(length)
     right(90)
     forward(length)
     right(90)
     forward(length)
     right(90)
     forward(length)
     right(90)


If-statements could possibly be used with some sort of random  
behavior (if rand()<0.5 ...).  Are there any other situations, using  
turtle, that these structures would be natural?



			thanks,

				Brian Blais

-- 
Brian Blais
bblais at bryant.edu
http://web.bryant.edu/~bblais



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20091129/706de5cb/attachment.htm>


More information about the Edu-sig mailing list