Simple Practice Programs

Peter Hansen peter at engcorp.com
Tue Jun 29 00:23:59 EDT 2004


Brian Martin wrote:

> If I have gone through several beginner python tuts and understand 
> basics, what's next?
> It seems there are very many very beginning tutorials but after that 
> there is a large absence as far as tutorials.  Any suggestions for a 
> simple program to write?

The best simple program to write is always (IMHO) the one which
actually gives you back some value.  What do _you_ want to use
your programming skills for?  Pick some particular task that you
want to automate (CD collection, waking you up in the morning,
whatever) or a game idea you have or the world's Next Great
Editor or something, and start writing it.

A couple of universal truths exist though:

1. You won't actually ever finish it.  Don't let that stop you.

2. You'll learn an awful lot more than if you just follow
someone else's idea of what I envision you mean by "practice program".

A slight variation on this approach is also a good one.  At
least, it's how I started out(*) when I was much younger and I
think it would still work well, especially with a language
like Python.  Find a cool game, perhaps written with PyGame,
and start hacking away on it.  Give yourself unlimited lives,
or add a new level, or just muck around in the guts of it
trying to figure out what a particular routine does and how
it does it.  Since you're working with real code, you'll
learn how to work with real code instead of "laboratory"
code that you might find in a practice program but never
in the real world.

-Peter

(*) More specifically, it was a Star Trek game written in
BASIC on a CBM 8032, with little asterisks and hash symbols
that fired little slashes and hyphens at each other across a
10x10 sector of periods.... great fun at the time.



More information about the Python-list mailing list