How to Learn Python with Games (a 4-Week Plan)
Games are the most motivating way to learn Python because you get something you want to play at the end, and every bug shows up straight away. The trick is the order: start with games that use one or two ideas, then move to games that combine them.
Here is a plan using the 20 games on this site. Spend 20-40 minutes a day. For each game: play it, read the build steps, then pass its three challenges before moving on.
Week 1: talking to the player
Goal: print(), input(), variables, if and your first loops.
- #07☆☆☆
Mad Libs-Style Story Game in Python
Learn input() and print(), Strings and Variables.
- #05☆☆☆
Number Guessing Game in Python
Learn The random module, while loops and if, elif and else.
- #16☆☆☆
Coin Flip in Python
Learn The random module, for loops and Variables.
- #14☆☆☆
Higher or Lower Game in Python
Learn The random module, while loops and if, elif and else.
- #02☆☆☆
Rock Paper Scissors in Python
Learn The random module, Dictionaries and if, elif and else.
Week 2: words, lists and dictionaries
Goal: strings, lists, sets and dictionaries. These games store more than one value at a time.
- #04☆☆☆
Hangman in Python
Learn Strings, Lists and while loops.
- #18☆☆☆
Python Quiz Game
Learn Dictionaries, Lists and for loops.
- #19☆☆☆
Math Quiz Game in Python
Learn The random module, Dictionaries and for loops.
- #15☆☆☆
Word Guessing Game in Python
Learn Strings, Lists and Dictionaries.
- #20☆☆☆
Typing Speed Game in Python
Learn Strings, Functions and for loops.
Week 3: boards and grids
Goal: functions and 2D lists. You'll write win checks, neighbour counts and a simple computer player.
- #01☆☆☆
Tic Tac Toe in Python
Learn Lists, Functions and if, elif and else.
- #12☆☆☆
Battleship-Style Game in Python
Learn 2D lists and grids, The random module and Strings.
- #09☆☆☆
Connect Four-Style Game in Python
Learn 2D lists and grids, Lists and Functions.
- #08☆☆☆
Text Adventure Game in Python
Learn Dictionaries, Strings and while loops.
- #17☆☆☆
Turtle Race in Python
Learn Turtle graphics, Lists and for loops.
Week 4: algorithms and graphics
Goal: recursion, searching and animation. These are the projects people put in their first portfolio.
- #10☆☆☆
Minesweeper-Style Game in Python
Learn 2D lists and grids, Functions and for loops.
- #13☆☆☆
Maze Game in Python
Learn 2D lists and grids, Functions and Lists.
- #11☆☆☆
Sudoku in Python
Learn 2D lists and grids, Functions and for loops.
- #03☆☆☆
Snake Game in Python (Turtle)
Learn Turtle graphics, Lists and Functions.
- #06☆☆☆
Pong-Style Paddle Game in Python
Learn Turtle graphics, Functions and if, elif and else.
How to practise so it sticks
- Type, don't paste. Typing the code yourself is when the syntax goes into your memory.
- Change one thing. After a game works, change a rule: more lives, a bigger board, a new word list.
- Read the error's last line. It names the problem (NameError, IndentationError). The line number points at where to look.
- Solve the challenge before peeking. Use the hint first. Seeing the answer too early skips the part where you learn.
- Build one game from scratch. At the end of each week, close the page and rewrite one game from memory.
Do I need to install anything?
Not to start. Every console game and challenge here runs real Python in your browser. When you're ready, install Python on your computer to run the turtle games with keyboard control and to save your own projects.
Frequently asked questions
Can you really learn Python by making games?
Yes. Games use the same building blocks as any program: variables, conditions, loops, lists, dictionaries and functions. The difference is that you want to finish them, which keeps you practising.
How long does it take to learn Python with games?
Following this plan, about four weeks of short daily sessions gets a beginner from print() to recursion and grid algorithms. Becoming fluent takes longer, so keep building your own games afterwards.
What is the best first Python game to make?
A number guessing game. It needs only random.randint, a while loop, input() and an if statement, and it's fun to play straight away.