Need some simple coding help

Steven Bethard steven.bethard at gmail.com
Wed Mar 2 09:49:51 EST 2005


mx2k wrote:
> ah, and sorry for that 'unreadable' code, but that was our first try of
> coding ever. we're working through the python documentaion right now -
> and - thanks to the post by STeVe we at last now that we have to
> construct a class for our purpose.

Well, you don't *have* to -- it could be done all with lists as you had. 
  But I think you'll find that it lends itself to a much cleaner 
solution.  Also, if you ever find yourself writing a list of 5 or more 
if statements, you're probably not going at the problem from the easiest 
angle.  Ask around, tell people what you're trying to do, and what you 
think your if statements are doing now, and they can probably point you 
to the easier way.

STeVe



More information about the Python-list mailing list