Python Turtle · 5 lessons
Build your own Snake game
Play it right here, then learn to code it yourself, one 30-minute lesson at a time.
See the lessonsScore 0
Best 0
Press an arrow key or swipe to start
Arrow keys or WASD to steer. Eat the red dots. Don’t hit the walls or your tail.
From empty window to finished game
Every lesson ends with something that runs, so you always leave with a win.
- 1
A square that moves
Open a window and steer a square with the arrow keys.
30 min - 2
Keep moving
Make the game loop run by itself and restart at the wall.
30 min - 3
Food
Drop random food on the screen and eat it.
30 min - 4
The growing tail
Grow a tail that follows the head around.
30 min - 5
Score and reset
Add a score and a clean restart. Your game is done.
30 min