“Invent Your Own Computer Games with Python” is a free book that teaches you how to program in the Python programming language. Each chapter gives you the complete source code for a new game, and then teaches the programming concepts from the example.
“Invent with Python” was written to be understandable by kids as young as 10 to 12 years old, although it is great for anyone of any age who has never programmed before.
This second edition has revised and expanded content, including using the Pygame library to make games with graphics, animation, and sound.
You can buy it or read/download it online CC version.