Skip to content
Python

Python Course: Learn Python From Beginner to Advanced

Ihsan Ullah · 5 min read
Free Python course cover: 63 short lessons from beginner to advanced with runnable code, exercises and projects

Quick answer: This is a free, step-by-step Python course in 63 short lessons, in a fixed order. Each lesson teaches one topic with code you can run, the real output, exercises with solutions, and the mistakes beginners usually make. Start with Lesson 1 and follow the “Next lesson” link at the end of each page.

The course goes from installing Python to testing, APIs and two capstone projects. It teaches Python 3 as it is used today, including modern project setup with virtual environments and pyproject.toml. New lessons are added in order; 30 of 63 are live now, and lessons that are not published yet are listed without a link.

Who this Python course is for

  • Complete beginners who have never programmed.
  • Students and analysts who want Python for data science, data engineering or AI work.
  • People who know a little Python but learned it in pieces and want the gaps filled in order.

You need a computer (Windows, macOS or Linux) and about 30 to 60 minutes per lesson. No paid software is needed.

How to use this course

  1. Read the lessons in order. Each one names what you should know before you start.
  2. Type the code yourself instead of copying it, then compare your output with the output shown.
  3. Do the “Try it yourself” exercises before you look at the solutions.
  4. Finish each level with its practice set or project before you move on.

Python course outline

Level 1: Foundations

Module 1: Getting started

Module 2: Values

Module 3: Control flow

Level 2: Core

Module 4: Data structures

Module 5: Functions

Module 6: Modules and environments

Level 3: Intermediate

Module 7: Files and errors

  • Lesson 32: Read and write text files (with, encoding) (coming soon)
  • Lesson 33: Work with paths using pathlib (coming soon)
  • Lesson 34: CSV and JSON files (coming soon)
  • Lesson 35: Exceptions: try, except, else, finally (coming soon)
  • Lesson 36: Raising and custom exceptions (coming soon)
  • Lesson 37: Debugging with breakpoint()/pdb and the logging module (coming soon)

Module 8: OOP in Python

  • Lesson 38: Classes and objects (coming soon)
  • Lesson 39: Instance, class and static methods; @property (coming soon)
  • Lesson 40: Inheritance and super() (coming soon)
  • Lesson 41: Dunder (magic) methods (coming soon)
  • Lesson 42: dataclasses (coming soon)
  • Lesson 43: Composition, ABCs and Protocols: designing classes (coming soon)

Level 4: Advanced

Module 9: Advanced Python

  • Lesson 44: Iterators and the iteration protocol (coming soon)
  • Lesson 45: Generators and yield (coming soon)
  • Lesson 46: Closures and decorators (coming soon)
  • Lesson 47: Context managers (with, contextlib) (coming soon)
  • Lesson 48: Type hints and static checking (mypy/pyright) (coming soon)
  • Lesson 49: Threads vs processes vs asyncio (coming soon)
  • Lesson 50: asyncio basics: async, await, tasks (coming soon)
  • Lesson 51: Measure and speed up Python code (timeit, cProfile) (coming soon)

Module 10: Testing

  • Lesson 52: Testing with pytest: your first tests (coming soon)
  • Lesson 53: pytest fixtures, parametrize and mocking (coming soon)
  • Lesson 54: Formatting and linting (Ruff) + pre-commit (coming soon)

Level 5: Projects and real-world Python

Module 11: APIs

  • Lesson 55: Call web APIs with requests (coming soon)
  • Lesson 56: Build your first API with FastAPI (coming soon)
  • Lesson 57: Configuration and secrets: environment variables and .env (coming soon)

Module 12: Projects

  • Lesson 58: Python projects for beginners (coming soon)
  • Lesson 59: Python projects for intermediate developers (coming soon)
  • Lesson 60: Capstone: a packaged command-line tool with tests (coming soon)
  • Lesson 61: Capstone: REST API with FastAPI, SQLite and pytest (coming soon)

Module 13: Next steps

Frequently asked questions

Is this Python course free?

Yes. Every lesson is free to read on this site, and all the tools used in the course (Python, VS Code, pip, venv, pytest) are free and open source.

How long does it take to finish the Python course?

There are 63 lessons, and most take 30 to 60 minutes with the exercises. At one lesson a day you would finish the core levels (1 to 3) in about six weeks, but the speed is up to you.

Do I need to know math to learn Python?

No. The course uses only basic arithmetic. Statistics and other math come later, in the Data Science and Machine Learning courses, when you need them.

What should I learn after Python?

That depends on your goal. For data work, continue with SQL and then Data Science. For AI, continue with Machine Learning. The last module of this course points to the right next step.

Start the course

Begin with Lesson 1: What Python is and what it is used for.

Ihsan Ullah

Written & tested by Ihsan Ullah

Data analyst with 3 years of experience and a Bachelor's degree in Computer Science. I write clear, practical guides on data, SQL, Python and AI.

More about me →

Leave a comment

Your email address will not be published. Required fields are marked *