Exercise: Playing a Little Game
This hour has really been full of catch-22's: familiar operators behaving differently depending on context, a handful of new operators and functions, and quite a few new rules to remember about syntax. To keep you from developing any hang-ups, I've added this exercise, which puts your knowledge of arrays and lists to good use—a game.
When you're done, try running the program by typing the following at a command line:
Listing 4.3 shows a sample of the Hangman program's output.