Skip to content
Python Tutorials

Python Tutorials

Pages in this section

Python Basics Explained — Complete Beginner's Guide (2026)

Python basics tutorial covering variables, data types, operators, strings, and user input. Step-by-step guide with examples and practice exercises for beginners.

✓ Live

Python Control Flow Explained — Conditionals and Loops Step-by-Step

Master Python control flow - if/elif/else conditionals, for and while loops, break/continue, match statements. Includes flowcharts, examples, and practice exercises.

✓ Live

Python Functions Explained — Complete Step-by-Step Guide with Examples

Learn Python functions - def, parameters, return values, *args and **kwargs, lambda, scope, type hints, and docstrings. Includes diagrams, common mistakes, and mini project.

✓ Live

Python Lists & Dicts Explained — Complete Guide with Examples

Master Python collections - lists, tuples, dicts, sets, list comprehensions, slicing, zip, and enumerate. Includes diagrams, common mistakes, FAQ, and a grade tracker mini project.

✓ Live

Python Modules & Packages Explained — Complete Guide with Examples

Learn Python modules and packages - import statements, creating your own modules, pip, virtual environments, and standard library highlights. Includes diagrams, common mistakes, and mini project.

✓ Live

Python File I/O & Error Handling Explained — Complete Guide with Examples

Learn Python file input/output and exception handling - read/write files, try/except blocks, context managers, JSON and CSV formats. Includes diagrams, common mistakes, and a journal app mini project.

✓ Live

Django Web Framework Guide

Learn Django: models, views, templates, URLs, admin interface, authentication, REST APIs with DRF, and building production web applications with Python.

✓ Live

Python OOP — Deep Dive with Examples

Master Python OOP — classes, inheritance, polymorphism, encapsulation, @property, magic methods, dataclasses. Build a BankAccount class with full code examples.

✓ Live

Python Decorators — Explained with Examples

Learn Python decorators — functions as first-class objects, @syntax, functools.wraps, decorators with args, class decorators, built-in decorators. Includes timing decorator example.

✓ Live

Python Generators & Iterators — Explained with Examples

Learn Python generators and iterators — yield, generator expressions, itertools, send()/throw()/close(), memory efficiency. Includes large file reading example.

✓ Live

Python Error Handling — Exceptions, Logging & Best Practices

Master Python error handling — try/except/else/finally, custom exceptions, exception chaining, context managers, assert, logging best practices. Includes file I/O example.

✓ Live

Python Testing — Complete Guide with pytest

Learn Python testing with unittest and pytest — fixtures, parametrize, mocking (unittest.mock), coverage. TDD workflow example. Test a calculator app step by step.

✓ Live

Python Async Programming — asyncio, async/await Explained

Learn Python async programming with asyncio — async/await, event loop, tasks, futures, aiohttp. When async helps vs hurts. Build an async web scraper example.

✓ Live

Python Type Hints — Complete Guide with mypy

Learn Python type hints — basic types, Optional, Union, List/Dict generics, TypedDict, Protocols, mypy static analysis, type narrowing. Build a type-hinted data processor.

✓ Live

Flask Web Framework Guide

Learn Flask: routes, templates, Jinja2, SQLAlchemy, forms, blueprints, REST APIs, and building lightweight Python web applications.

✓ Live

Python Context Managers — with Statement Explained

Learn Python context managers — with statement, __enter__/__exit__, contextlib.contextmanager, ExitStack. Real-world examples: file handles, database connections, locks.

✓ Live

How to Fix ModuleNotFoundError in Python

Fix Python ModuleNotFoundError — missing pip install, wrong virtualenv, circular imports, PYTHONPATH issues. Step-by-step solutions with examples.

✓ Live

How to Fix TypeError in Python

Fix Python TypeError — unsupported operand type, object is not callable, cannot unpack non-iterable. Common variants explained with code examples and solutions.

✓ Live

How to Fix AttributeError in Python

Fix Python AttributeError — 'object has no attribute'. Common causes: typo in method name, NoneType has no attribute, missing __init__, naming conflicts.

✓ Live

How to Fix ImportError in Python

Fix Python ImportError — 'cannot import name'. Circular imports, wrong import path, outdated package, renamed module. Step-by-step solutions with examples.

✓ Live

How to Fix KeyError in Python

Fix Python KeyError — missing dictionary key. Solutions: .get() with default, defaultdict, setdefault, try/except, .keys() check. Step-by-step examples.

✓ Live

FastAPI Framework Guide

Learn FastAPI: path operations, request validation with Pydantic, dependency injection, async support, WebSocket, and building high-performance APIs with Python.

✓ Live

CherryPy Python Framework Guide — Build Lightweight Web Applications

Learn CherryPy - object-oriented HTTP framework with built-in server, tools, plugins, and minimal configuration. Step-by-step guide with examples for building lightweight Python web applications.

✓ Live

Web2py Python Framework Guide — Build Database-Driven Web Applications

Learn Web2py - full-stack Python web framework with web-based IDE, DAL database abstraction, ticketing system, and built-in security. Step-by-step guide with examples.

✓ Live