[Tutor] How to teach Python

Elaine lavendula6654 at yahoo.com
Sun Aug 13 00:09:21 CEST 2006


I am going to be teaching "Introduction to Python
Programming" in the Fall at Foothill College in Los
Altos Hills, CA. This is a 5 quarter unit class for
students who already know one programming language.

I have been teaching programming for 20 years now,
including Java and C++ as of late. As I prepare this
class, I have some questions that I I am hoping you
can shed some light on.

1) Programming Style 

         while 1:
              x = next()
              if not x: break

I have never allowed students to use break or continue
in any 
programming class I have taught. I think of this type
of code as belonging with the dreaded GOTO.

I find that students who are having difficulty writing

complex conditions in a loop use multiple if's with
break's 
inside the loop instead. Also, it is MUCH easier to
read a 
loop if the condition for continuing in the loop is
right up 
at the top of the loop where it belongs.

I have always thought of break and continue as hacks
that 
are not compatible with structured programming
techniques. 
The only exception is using break in a switch in C,
C++ and 
Java.

However, all Python books seem to contain sample
programs like this one. Do you think that code like
this is desirable?

2) Since this is an introductory class, I am tempted
to leave out "optional" topics like argument matching
modes, walk, map, filter, reduce, apply. Do you think
these are required for any Python programmer?

3) I need to teach a GUI in this class. I would like
something that is easy, standard, and multi-platform.
I am considering Tkinter and Jython. Any opnions on
this?

Thanks for any answers you might have.

-Elaine Haight



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Tutor mailing list