Skip to content

A simple respository for learning python from basics up to a snake terminal game as a final project.

Notifications You must be signed in to change notification settings

bralton/python-learning-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Learning Path

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.

Overview

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

Prerequisites

  • 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!

Setup Instructions

1. Install Python

Download and install Python from python.org

Verify installation:

python --version
# or
python3 --version

2. Install VS Code (Recommended)

This learning path uses collapsible comment regions for hints. VS Code supports this feature out of the box.

  1. Download VS Code
  2. Install the Python extension (Microsoft)
  3. Open this folder in VS Code

3. Test Collapsible Comments

Open test_collapsible_comments.py to verify the setup:

  • Look for small arrows (▼ or ►) next to line numbers where # region appears
  • 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.

Learning Path

Level 1: Basics (Exercises 01-05)

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


Level 2: Control Flow & Loops (Exercises 06-10)

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


Level 3: Data Structures (Exercises 11-16)

Concepts: Lists, dictionaries, sets, tuples, list comprehensions

Exercises:

  • 11: Lists Basics
  • 12: Dictionaries
  • 13-16: Advanced data structure manipulation

Time: 4-5 hours


Level 4: Functions (Exercises 17-21)

Concepts: Defining functions, parameters, return values, scope, lambda functions

Exercises:

  • 17: Functions Basics
  • 18-21: Advanced function concepts

Time: 3-4 hours


Level 5: Intermediate Concepts (Exercises 22-25)

Concepts: String manipulation, file I/O, error handling, modules

Time: 3-4 hours


Level 6: Recursion & Algorithms (Exercises 26-30)

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


Level 7: Object-Oriented Programming (Exercises 31-34)

Concepts: Classes, objects, methods, attributes, inheritance

Exercises:

  • 31: Classes Basics
  • 32-34: Building practical OOP applications

Time: 4-5 hours


Level 8: Final Project (Exercise 35)

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


How to Use This Repository

Working Through Exercises

  1. Start with Exercise 01 in exercises/level_1_basics/
  2. Read the exercise description at the top
  3. Complete the TODO tasks in order
  4. Use the hints if you get stuck (click the arrow to expand)
  5. Run your code to test it:
    python exercises/level_1_basics/01_hello_world.py
  6. Check the solution after attempting (in solutions/ folder)
  7. Move to the next exercise

Getting Unstuck

If you're stuck on an exercise:

  1. Read the hints - Click the arrows to expand collapsed regions
  2. Review previous exercises - Often the solution uses concepts you've already learned
  3. Check the solution - It's okay to peek! Try to understand, then attempt on your own
  4. Take a break - Sometimes stepping away helps
  5. Search online - Look up specific concepts on Python documentation or tutorials

Best Practices

  • 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

Running Your Code

From Terminal/Command Line

# Navigate to the exercise directory
cd exercises/level_1_basics

# Run an exercise
python 01_hello_world.py

From VS Code

  1. Open the exercise file
  2. Click the "Run" button (▶️) in the top right
  3. Or press F5 to run with debugger

Tips for Success

  1. Be consistent - 30-60 minutes daily is better than 5 hours once a week
  2. Don't rush - Understanding is more important than speed
  3. Practice debugging - Errors are learning opportunities
  4. Build projects - After completing exercises, create your own programs
  5. Join communities - r/learnpython, Python Discord servers
  6. Read code - Study the solutions to see different approaches

Common Issues

Import Errors

If you get ModuleNotFoundError, ensure you're in the correct directory or the module is installed.

Python Not Found

Make sure Python is installed and added to your PATH. Try python3 instead of python.

Collapsible Comments Not Working

This feature requires VS Code or a compatible IDE. If using a different editor, hints are still readable - they just won't collapse.

Project Structure

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/
    └── ...

What's Next?

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!

Resources

Contributing & Feedback

Found a bug or have suggestions? This repo was created as a personal learning resource, but feedback is welcome!

License

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! 🚀🐍

About

A simple respository for learning python from basics up to a snake terminal game as a final project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages