Python Tutorial
A complete Python path from absolute beginner to advanced - clear explanations, practical examples, and projects you can actually build.
Curriculum
Work through each section in order. Every lesson ends with practice and key points so the idea sticks.
Getting Started
- 1What is Python?
Learn what Python is, where it is used, and why it is a friendly first programming language.
8 min - 2Install Python & Your Editor
Install Python 3, check that it works, and choose a beginner-friendly code editor.
10 min - 3Your First Python Program
Write, save, and run a small Python program that prints messages and uses variables.
9 min - 4Syntax, Indentation & Style
Understand Python syntax rules, why indentation matters, and how clean style makes code easier to read.
11 min - 5Comments
Use comments to explain why code exists without changing how the program runs.
7 min
Foundations
- 6Variables
Learn how variables store values, why names matter, and how reassignment works.
10 min - 7Data Types
Meet the common Python data types: strings, integers, floats, booleans, and None.
11 min - 8Type Conversion
Convert values between strings, numbers, and booleans when your program needs a different type.
11 min
Working with Data
- 9Numbers
Work with integers, floats, arithmetic, rounding, and number-friendly shortcuts.
10 min - 10Strings
Store and work with text using strings, indexing, slicing, and simple formatting.
11 min - 11String Methods
Use common string methods to clean, search, and transform text.
10 min - 12Booleans & Comparisons
Use True and False values to ask questions and make decisions in Python.
9 min - 13Operators
Learn the operators Python uses for math, comparison, assignment, and logic.
10 min
Collections
- 14Lists
Store ordered collections with lists, then read, update, add, and remove items.
12 min - 15Tuples
Use tuples for ordered values that should stay together and not be changed.
9 min - 16Sets
Use sets to store unique values and compare groups of items.
10 min - 17Dictionaries
Store labeled data with dictionaries using keys and values.
12 min
Control Flow
- 18if, elif & else
Make decisions in Python with if statements, elif branches, and else fallbacks.
11 min - 19for & while Loops
Repeat work with for loops and while loops without copying the same code many times.
12 min - 20break, continue & else on Loops
Control loop behavior with break, continue, and loop else blocks.
11 min
Functions
- 21Functions
Group reusable steps into functions so your programs are easier to read and maintain.
12 min - 22Parameters, Defaults & Return Values
Pass information into functions, set defaults, and return useful results.
13 min - 23Scope & LEGB
Understand where Python looks for variable names and why scope keeps programs organized.
13 min - 24Modules & import
Use modules to organize code and import helpful tools from Python files and the standard library.
12 min
Everyday Python
Pythonic Tools
- 26List Comprehensions
Create new lists from existing data with clear, compact Python expressions.
11 min - 27Dict & Set Comprehensions
Build dictionaries and sets from existing data without repetitive loop boilerplate.
12 min - 28Lambda Functions
Use small anonymous functions in places where Python expects a callable.
10 min - 29map, filter & sorted
Transform, filter, and order data with Python built-ins and readable callbacks.
12 min
Files & Data
- 30Reading & Writing Files
Read text files, write reports, and use context managers to close files safely.
13 min - 31Paths with pathlib
Use pathlib to create, combine, inspect, and read filesystem paths cleanly.
11 min - 32Working with JSON
Read, write, and validate JSON data with Python dictionaries and lists.
12 min - 33CSV Files
Read and write spreadsheet-friendly CSV files with Python’s csv module.
12 min
Errors & Robustness
Object-Oriented Python
- 36Classes & Objects
Define classes that group data and behavior into reusable Python objects.
13 min - 37Instance Methods, Attributes & self
Understand how object attributes and instance methods work together through self.
12 min - 38Inheritance & super()
Reuse and extend class behavior with inheritance and super().
13 min - 39Dunder / Magic Methods
Make objects work naturally with print(), len(), comparisons, and other Python behavior.
12 min
Tooling
Standard Library Power
Modern Python
Talking to the Web
Quality
Deep Python
- 49Iterators & Generators
Understand Python iteration deeply: iterable objects, iterator state, generator functions, yield, lazy pipelines, and generator expressions.
16 min - 50Decorators
Learn how decorators wrap functions, preserve metadata, accept arguments, and cleanly add cross-cutting behavior.
17 min - 51Context Managers
Use with statements, __enter__, __exit__, contextlib, and ExitStack to manage resources safely and clearly.
15 min
Concurrency
Pro Architecture
- 54Practical OOP Patterns
Use dataclasses, composition, protocols, dependency injection, factories, and repositories without over-engineering.
17 min - 55Structuring Larger Python Projects
Organize Python applications with packages, src layout, tests, configuration, entry points, and clear boundaries.
16 min - 56Packaging & Distributing Python Code
Package Python code with pyproject.toml, build wheels, expose console scripts, and understand versioning and distribution basics.
16 min - 57Performance Mindset & Profiling
Approach Python performance scientifically with measurement, profiling, better algorithms, caching, streaming, and focused optimization.
17 min - 58Security Basics for Python Apps
Protect Python applications with safe input handling, secret management, dependency hygiene, authentication basics, and secure defaults.
18 min
Capstone Projects
- 59Mini Project: CLI Task Manager
Build a small command-line task manager with argparse, JSON storage, a clean file structure, and practical commands.
20 min - 60Mini Project: Small REST API (FastAPI-style)
Build a small FastAPI-style REST API with models, routes, validation, in-memory storage, and a professional project shape.
20 min - 61Mini Project: Data Cleaning Script
Build a data cleaning script that reads CSV files, validates rows, normalizes values, writes clean output, and reports rejected records.
19 min - 62Mini Project: Web Scraper (Responsible)
Build a respectful web scraper that checks rules, rate limits requests, parses HTML, saves JSON, and avoids harmful scraping behavior.
20 min
Polish & Next Steps
- 63Common Python Mistakes (and Fixes)
Review frequent Python bugs and design problems: mutable defaults, broad exceptions, shadowing, late binding, imports, and hidden state.
16 min - 64The Python Ecosystem (Web, Data, Automation)
Map the Python ecosystem across web development, data science, automation, testing, packaging, tooling, and deployment.
14 min - 65What to Learn After This Path
Plan your next Python learning path with specialization tracks, portfolio projects, testing habits, reading practice, and professional growth.
12 min