SimplePrograms challenge

Steve Howell showell30 at
Mon Jun 11 23:56:05 CEST 2007

Hi, I'm offering a challenge to extend the following
page by one good example:

Right now the page starts off with 15 examples that
cover lots of ground in Python, but they're still
scratching the surface.  (There are also two Eight
Queens implementations, but I'm looking to fill the
gap in lines-of-code, and they're a little long now.)

I'm looking for a good 16-line code example with the
following qualities:

  1) It introduces some important Python concept that
the first 15 programs don't cover.

  2) It's not too esoteric.  Python newbies are the
audience (but you can assume they're not new to
programming in general).

  3) It runs on Python 2.4.

  4) It doesn't just demonstrate a concept; it solves
a problem at face value.  (It can solve a whimsical
problem, like counting rabbits, but the program itself
should be "complete" and "suitably simple" for the
problem at hand.)

  5) You're willing to have your code reviewed by the

  6) No major departures from PEP 8.

Any takers?

-- Steve

Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.

More information about the Python-list mailing list