Chapter Guide

Use this page to map the book to the source files in the repository.

ChapterFileWhat it contains
1 hello.pyA simple first program.
2 guess_game_v1.pyVersion 1 - The first guessing game version.
3 guess_game_v2.pyVersion 2 - The next step in the game’s evolution.
4 guess_game_v3.pyVersion 3 - Looping and repeated play concepts start taking shape.
5 guess_game_v4.pyVersion 4 - Another refinement in the model.
6 guess_game_v5.pyVersion 5 - The game becomes more capable.
7 guess_game_v6.pyVersion 6 - Nested logic for a smarter game.
8 guess_game_v7.pyVersion 7 - Nested loops to replay the game
9 guess_game_v8.pyVersion 8 - The game becomes more resilient.
10prompts.mdAI prompt examples and cautionary notes.

How to run a file

To run the code, copy it into your Python environment and execute it locally.
You can also download the raw file from GitHub.

From a terminal or command prompt, you can run the file with a command like this:

python code/chapter-02/guess_game_v1.py

If that does not work, try:

python3 code/chapter-02/guess_game_v1.py