Welcome to your Python programming journey! This repository contains a structured, progressive series of exercises designed to take you from complete beginner to building your own terminal-based Snake game.
This learning path consists of 35 exercises organized into 8 levels, each building on the concepts from previous levels. Each exercise includes:
- Clear task descriptions
- Guided comments explaining concepts
TODO:markers where you'll write code- Collapsible hints using region markers (see setup below)
- Complete solutions for reference
- Python 3.7+ installed on your computer
- A code editor (VS Code recommended - see setup instructions)
- Basic computer literacy (file navigation, running programs)
- Enthusiasm to learn!
Download and install Python from python.org
Verify installation:
python --version
# or
python3 --versionThis learning path uses collapsible comment regions for hints. VS Code supports this feature out of the box.
- Download VS Code
- Install the Python extension (Microsoft)
- Open this folder in VS Code
Open test_collapsible_comments.py to verify the setup:
- Look for small arrows (▼ or ►) next to line numbers where
# regionappears - Click the arrows to collapse/expand hint sections
- If you see these arrows, you're all set!
Alternative IDEs: PyCharm, Sublime Text, and some other editors also support region markers, but your experience may vary.
Concepts: Print statements, variables, data types, user input, string formatting, conditionals
Exercises:
- 01: Hello World & Print Statements
- 02: Variables and Data Types
- 03: User Input and String Formatting
- 04: Basic Arithmetic and Operators
- 05: Conditional Statements (if/elif/else)
Time: 2-3 hours
Concepts: For loops, while loops, break/continue, nested loops, loop patterns
Exercises:
- 06: For Loops
- 07: While Loops
- 08: Break and Continue
- 09: Nested Loops
- 10: Loop Patterns (FizzBuzz, Fibonacci, Primes)
Time: 4-5 hours
Concepts: Lists, dictionaries, sets, tuples, list comprehensions
Exercises:
- 11: Lists Basics
- 12: Dictionaries
- 13-16: Advanced data structure manipulation
Time: 4-5 hours
Concepts: Defining functions, parameters, return values, scope, lambda functions
Exercises:
- 17: Functions Basics
- 18-21: Advanced function concepts
Time: 3-4 hours
Concepts: String manipulation, file I/O, error handling, modules
Time: 3-4 hours
Concepts: Recursive thinking, tree traversal (DFS/BFS), searching algorithms
Exercises:
- 26: Introduction to Recursion
- 27: Tree Search (DFS and BFS)
- 28-30: Sorting algorithms and more
Time: 5-6 hours
Concepts: Classes, objects, methods, attributes, inheritance
Exercises:
- 31: Classes Basics
- 32-34: Building practical OOP applications
Time: 4-5 hours
Project: Terminal-Based Snake Game
Build a complete, playable Snake game using everything you've learned:
- OOP design (Snake, Food, Game classes)
- Game loop
- Collision detection
- User input handling
- Terminal graphics
Time: 6-8 hours
- Start with Exercise 01 in
exercises/level_1_basics/ - Read the exercise description at the top
- Complete the TODO tasks in order
- Use the hints if you get stuck (click the arrow to expand)
- Run your code to test it:
python exercises/level_1_basics/01_hello_world.py
- Check the solution after attempting (in
solutions/folder) - Move to the next exercise
If you're stuck on an exercise:
- Read the hints - Click the arrows to expand collapsed regions
- Review previous exercises - Often the solution uses concepts you've already learned
- Check the solution - It's okay to peek! Try to understand, then attempt on your own
- Take a break - Sometimes stepping away helps
- Search online - Look up specific concepts on Python documentation or tutorials
- Type the code yourself - Don't copy/paste solutions
- Experiment - Try variations and see what happens
- Break large problems into smaller steps
- Use descriptive variable names
- Add your own comments to help you remember
- Challenge yourself - Try to solve without hints first
# Navigate to the exercise directory
cd exercises/level_1_basics
# Run an exercise
python 01_hello_world.py- Open the exercise file
- Click the "Run" button (
▶️ ) in the top right - Or press
F5to run with debugger
- Be consistent - 30-60 minutes daily is better than 5 hours once a week
- Don't rush - Understanding is more important than speed
- Practice debugging - Errors are learning opportunities
- Build projects - After completing exercises, create your own programs
- Join communities - r/learnpython, Python Discord servers
- Read code - Study the solutions to see different approaches
If you get ModuleNotFoundError, ensure you're in the correct directory or the module is installed.
Make sure Python is installed and added to your PATH. Try python3 instead of python.
This feature requires VS Code or a compatible IDE. If using a different editor, hints are still readable - they just won't collapse.
python-learning-path/
├── README.md # This file
├── test_collapsible_comments.py # Test file for VS Code features
├── exercises/ # Your workspace
│ ├── level_1_basics/
│ ├── level_2_control_flow/
│ ├── level_3_data_structures/
│ ├── level_4_functions/
│ ├── level_5_intermediate/
│ ├── level_6_algorithms/
│ ├── level_7_oop/
│ └── level_8_final_project/
└── solutions/ # Reference solutions
├── level_1_basics/
├── level_2_control_flow/
└── ...
After completing this learning path, you'll be ready for:
- Web Development: Learn Flask or Django
- Data Science: Explore pandas, NumPy, matplotlib
- Automation: Build scripts to automate tasks
- Game Development: Try Pygame for more advanced games
- APIs: Build RESTful APIs with FastAPI
- More Projects: Build your own applications!
- Official Python Documentation
- Python.org Tutorials
- Real Python
- Python Tutor - Visualize code execution
- LeetCode - Practice coding problems
Found a bug or have suggestions? This repo was created as a personal learning resource, but feedback is welcome!
This learning path is free to use for educational purposes. Feel free to share it with others learning Python!
Remember: Everyone learns at their own pace. Take your time, practice regularly, and most importantly - have fun coding!
Good luck on your Python journey! 🚀🐍