PyCourse
Zero to Advanced
Complete Python Course
Python: Zero to Advanced
A fully structured, resource-rich course with official docs, video links, exercises, and practice problems for every single topic — Beginner → Intermediate → Advanced.
Learning Roadmap
Beginner — Foundations (Modules 01–04) · ~4 weeks Python setup, syntax, variables, operators, control flow, functions, and built-in data structures.
Intermediate — OOP & Ecosystem (Modules 05–08) · ~5 weeks Object-oriented programming, file I/O, exceptions, comprehensions, generators, modules, and the standard library.
Advanced — Real-World Engineering (Modules 09–12) · ~6 weeks Decorators, async/concurrency, REST APIs, databases, testing, packaging, and ML fundamentals.
Beginner Level
01
Getting Started with Python
Install Python, write your first program, understand basic types
Week 1
Installing Python 3 & VS Code
Python interpreter & REPL
Hello World program
Comments & indentation rules
print() & input()
Variables & naming conventions
Data types: int, float, str, bool
Type conversion (int(), str()…)
f-strings & string formatting
Basic arithmetic operators
# Your first Python program
name = input ("What is your name? " )
age = int (input ("Your age? " ))
print (f"Hello {name}! In 10 years you'll be {age + 10}." )
02
Operators & Control Flow
Make decisions, create loops, and control program flow
Week 1–2
Arithmetic, comparison & assignment
Logical operators: and, or, not
if / elif / else statements
Ternary (conditional) expression
for loops & range()
while loops
break, continue, pass
Nested loops
match / case (Python 3.10+)
Loop else clause
# FizzBuzz
for i in range (1, 21):
if i % 15 == 0: print ("FizzBuzz" )
elif i % 3 == 0: print ("Fizz" )
elif i % 5 == 0: print ("Buzz" )
else : print (i)
03
Functions
Write reusable, clean, and well-documented functions
Week 2–3
Defining & calling functions
Parameters & return values
Default & keyword arguments
*args and **kwargs
Variable scope (local / global)
Lambda (anonymous) functions
Recursion with base case
Docstrings & help()
Positional-only parameters (/)
Function annotations
def greet (name: str, greeting: str = "Hello" ) -> str:
"""Return a personalised greeting string."""
return f"{greeting}, {name}!"
square = lambda x: x ** 2
print (square (7)) # 49
04
Data Structures
Lists, tuples, sets, and dictionaries — store and organise data
Week 3–4
Lists — create, index, slice
List methods: append, pop, sort…
Tuples & immutability
Sets & set operations
Dictionaries (key-value pairs)
Dict methods: get, items, keys…
Nested data structures
Unpacking & spread (*)
sorted(), min(), max(), sum()
enumerate() & zip()
student = {"name" : "Alice" , "grades" : [88, 92, 79]}
avg = sum (student["grades" ]) / len (student["grades" ])
print (f"Average: {avg:.1f}" )
# Unpacking
first, *rest = [1, 2, 3, 4, 5]
Intermediate Level
05
Object-Oriented Programming (OOP)
Classes, inheritance, encapsulation, and polymorphism
Week 5–6
Classes & objects
__init__ & self
Instance vs class attributes
Instance, class & static methods
Inheritance & super()
Method overriding
Encapsulation & name mangling
Dunder methods (__str__, __repr__…)
Abstract base classes (ABC)
Polymorphism & duck typing
from abc import ABC, abstractmethod
class Animal (ABC):
def __init__ (self, name): self.name = name
@abstractmethod
def speak (self): ...
class Dog (Animal ):
def speak (self): return f"{self.name}: Woof!"
print (Dog ("Rex" ).speak ())
06
File I/O & Exception Handling
Read/write files and handle errors gracefully
Week 6–7
open(), read(), write(), append
with statement & context managers
Reading / writing CSV files
JSON: load, dump, loads, dumps
try / except / else / finally
Built-in exception types
Custom exceptions (class)
raise & exception chaining
pathlib.Path for file paths
os & shutil basics
import json
from pathlib import Path
def load_config (path: str) -> dict:
p = Path(path)
if not p.exists():
raise FileNotFoundError (f"No config at {p}" )
return json.loads(p.read_text())
07
Comprehensions, Iterators & Generators
Write concise, Pythonic, memory-efficient code
Week 7–8
List comprehensions
Dict & set comprehensions
Conditional comprehensions
Nested comprehensions
Generator expressions
yield & generator functions
iter() & next()
Custom iterator class
map(), filter(), reduce()
itertools: chain, product, groupby
# Memory-efficient generator
def fibonacci (n):
a, b = 0, 1
for _ in range (n):
yield a
a, b = b, a + b
even_fibs = [x for x in fibonacci (30) if x % 2 == 0]
08
Modules, Packages & Virtual Environments
Structure projects, manage dependencies, standard library
Week 8–9
import & from…import
__name__ == "__main__"
Creating packages (__init__.py)
pip & PyPI
venv — create & activate
requirements.txt
datetime & time
math & random
re — regular expressions
collections module
Advanced Level
09
Advanced Python Features
Decorators, type hints, dataclasses, and metaclasses
Week 10–11
First-class functions & closures
Decorators (@wraps)
Stacking & parameterised decorators
Context managers (__enter__/__exit__)
contextlib.contextmanager
dataclasses module
Type hints & typing module
mypy static type checking
__slots__ for memory efficiency
Metaclasses basics
import functools, time
def timer (func):
@ functools.wraps(func)
def wrapper (*args, **kwargs):
t0 = time.perf_counter()
result = func (*args, **kwargs)
print (f"{func.__name__} → {time.perf_counter()-t0:.4f}s" )
return result
return wrapper
10
Async Programming & Concurrency
asyncio, threading, multiprocessing, and concurrent.futures
Week 11–12
async / await syntax
asyncio event loop
Coroutines & Tasks
asyncio.gather() & wait()
Async context managers
threading module
Thread locks & race conditions
multiprocessing module
concurrent.futures
GIL — understanding limits
import asyncio
async def fetch (url: str) -> str:
await asyncio.sleep(1) # simulate I/O wait
return f"data from {url}"
async def main ():
urls = ["api/users" , "api/posts" , "api/tags" ]
results = await asyncio.gather(*[fetch (u) for u in urls])
print (results)
11
Databases, APIs & Web
SQLite, SQLAlchemy, REST APIs with FastAPI, and HTTP clients
Week 13–14
SQLite3 — connect, execute, fetch
SQLAlchemy 2 ORM basics
Alembic migrations
httpx — async HTTP client
Parsing JSON responses
FastAPI — routes & path params
Pydantic data validation
Dependency injection (FastAPI)
JWT authentication
Environment variables & .env
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI ()
class Item (BaseModel ):
name: str
price: float
@ app.post("/items" )
async def create_item (item: Item ):
return {"id" : 1, **item.model_dump()}
12
Testing, Packaging & Data Science Intro
pytest, pyproject.toml, NumPy, pandas, and scikit-learn
Week 14–16
pytest basics & assertions
Fixtures & conftest.py
Parametrize & marks
unittest.mock & MagicMock
Code coverage (pytest-cov)
pyproject.toml setup
Publishing to PyPI (twine)
NumPy arrays & broadcasting
pandas DataFrames & groupby
scikit-learn — train & evaluate
import pytest
def add (a, b): return a + b
@ pytest.mark.parametrize("a,b,expected" , [
(1, 2, 3), (0, 0, 0), (-1, 1, 0)
])
def test_add (a, b, expected):
assert add (a, b) == expected
Practice Projects
01 — Number Guessing Game
Use loops, conditionals, and random to build a classic number-guessing CLI game with score tracking.
Beginner Loops Functions
02 — To-Do List CLI App
Create, read, update and delete tasks stored in a JSON file. Includes search and filter features.
Beginner File I/O JSON
03 — Secure Password Generator
Generate strong random passwords using the secrets module with configurable length and character sets.
Intermediate OOP secrets
04 — Student Grade Manager
OOP-based system to manage students, courses, and grades. Includes statistics (mean, median, GPA).
Intermediate OOP File I/O
05 — Web Scraper & CSV Export
Scrape structured data from a public site using httpx + BeautifulSoup, then save results to CSV.
Intermediate httpx CSV
06 — File Organiser Automation
Automatically sort files in a directory into subfolders by extension using os, shutil, and pathlib.
Intermediate pathlib shutil
07 — REST API — Task Manager
Full CRUD API with FastAPI, SQLite (via SQLAlchemy), Pydantic validation, and JWT authentication.
Advanced FastAPI SQLite JWT
08 — Async Weather Dashboard
Fetch weather data for multiple cities concurrently using asyncio + httpx and display a formatted report.
Advanced asyncio httpx
09 — Data Analysis Dashboard
Load a CSV dataset with pandas, compute statistics, detect outliers, and visualise with matplotlib.
Advanced pandas matplotlib
Recommended Tools & Libraries
Category Tool / Library Purpose Link
IDE VS Code + Pylance Editing, linting, IntelliSense Download
Formatting black Auto-format Python code Docs
Linting ruff Ultra-fast linter Docs
Type Checking mypy Static type analysis Docs
Testing pytest Unit & integration tests Docs
HTTP Client httpx Async HTTP requests Docs
Web Framework FastAPI Modern async REST APIs Docs
ORM SQLAlchemy 2 Database abstraction layer Docs
Data Science pandas + NumPy Data manipulation & math Docs
ML scikit-learn Classical machine learning Docs
Notebooks Jupyter Lab Interactive data exploration Docs
Env Manager uv Blazing-fast env & packages Docs
Learning Tips
Code every single day Even 20–30 minutes of daily practice beats weekend 4-hour sessions. Consistency is the #1 predictor of progress.
Read error messages top-to-bottom Python's tracebacks are your best friend. The most useful clue is almost always the last line.
Build projects, not just exercises Apply each module to a small project you care about. Real-world context cements learning far better than drills.
Use the REPL & Jupyter for experiments Before writing a complex function, prototype in the interactive shell or a Jupyter notebook cell.
Read other people's code Browse GitHub repos of popular Python projects. Reading good code teaches style, patterns, and idioms faster than any tutorial.
Live Python Terminal — Run Code in Your Browser
Write Python code below and click Run — executes 100% in your browser using Skulpt . No install needed. Supports print, input, loops, functions, classes, and more.
Python 3 — Browser Terminal
Skulpt Engine
EXAMPLES:
Hello World
FizzBuzz
Factorial
Comprehension
OOP Classes
Generator
Dict & Data
Lambda/Map
stdin (for input()):
output
Output will appear here after you click Run...
▶ Run
Clear Output
Clear Editor
Powered by Skulpt — Python 3 in browser