Python Programming for the Absolute Beginner, 3rd Edition

The Trivia Challenge game tests a player's knowledge with a series of multiple-choice questions. The game delivers the questions as a single "episode." The episode I created to show off the program is about the mafia and is called "An Episode You Can't Refuse." All of the questions relate in some way to the mafia (although a bit indirectly at times).

The cool thing about the game is that the questions for an episode are stored in a separate file, independent of the game code. This way, it's easy to play different ones. Even better, this means that anyone with a text editor (like Notepad on Windows machines) can create their own trivia episode about whatever topic they choose—anything from anime to zoology. Figure 7.1 shows the game (and my episode) in action.

Figure 7.1: The player is always presented with four inviting choices. But only one is correct.

Категории