HomeAll tracks · pricing · account
Python11 apps · Python, SQL & data
Start free Log in

BitSize Python · 62 Modules

Python, bite-sized.

One module at a time: the idea, the pitfalls, then a quiz.

step throughstep 1 / 4
price = 3.5
qty = 4
total = price * qty
print(f"£{total:.2f}")
 

Track your progress

Save where you are and see what you remember.

Sign up free →

All modules. Pass each quiz to unlock the next.

62 modules · concepts, pitfalls, and two quiz modes each

Lesson 1 Free · Lessons 2–3 Sign up · Lessons 4+ Subscribe
View Plans →
👋 Free
Module 1
Your First Python Program
Start here. Print your first lines, store values in variables, name them well, see how Python runs your …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Up nextContinue →
🐍
Module 2
Python Data Types
Master Python's core data types — strings, sets, numbers, lists, dictionaries, and tuples. Understand mutability, indexing, and when …
6 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⬆️
Module 3
Python Indentation
Understand how Python uses indentation instead of braces to define code blocks — and the common errors that …
3 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📝 🔒 Subscribe
Module 4
Comments and Documentation
Write clear single-line and multi-line comments, understand Python docstrings, and document functions and classes following PEP 257 and …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🌍 🔒 Subscribe
Module 5
Date and Time — Timezones and Parsing
Parse strings into datetime objects, work with timezone-aware datetimes, switch between timezones, iterate over date ranges, and handle …
6 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🗓️ 🔒 Subscribe
Module 6
Date Formatting
Master strftime and strptime format codes, compute time between datetimes, output ISO 8601 timestamps, and convert timestamps to …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🏷️ 🔒 Subscribe
Module 7
Enum — Enumerated Constants
Use Python's Enum class to create named, readable constants. Learn to access members by name, value, and iteration …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔵 🔒 Subscribe
Module 8
Sets — Operations and Use Cases
Master set operations — intersection, union, difference, symmetric difference, subset and superset checks, deduplication, and Counter for multisets.
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
➗ 🔒 Subscribe
Module 9
Mathematical Operators
Master Python's arithmetic operators — true vs floor division, modulus, exponentiation, in-place operators, logarithms, and trigonometry with the …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⚙️ 🔒 Subscribe
Module 10
Bitwise Operators
Understand how Python's bitwise operators work at the binary level — AND, OR, XOR, NOT, left shift, right …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
✅ 🔒 Subscribe
Module 11
Boolean Operators
Master Python's and, or, and not operators — understand short-circuit evaluation, truthy and falsey values, and how and/or …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📊 🔒 Subscribe
Module 12
Operator Precedence
Understand Python's operator evaluation order — PEMDAS, how boolean and comparison operators interact, and how parentheses override precedence …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔭 🔒 Subscribe
Module 13
Variable Scope and Binding
Understand local and global scope, the global and nonlocal keywords, closures, how Python looks up variable names (LEGB …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔀 🔒 Subscribe
Module 14
Conditionals
Master Python's if/elif/else, ternary expressions, truth value testing, boolean logic in conditions, and the 'in' operator for clean …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⚖️ 🔒 Subscribe
Module 15
Comparisons
Master Python's comparison operators — ==, !=, <, >, is, is not — understand chained comparisons, the difference …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔄 🔒 Subscribe
Module 16
Loops
Master for and while loops — break, continue, else clauses, enumerate, iterating dictionaries, unpacking in loops, and the …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📦 🔒 Subscribe
Module 17
Arrays and Multidimensional Lists
Understand Python's array module for typed collections, and master multidimensional data using lists of lists — creation, access, …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📖 🔒 Subscribe
Module 18
Dictionaries
Master Python dictionaries — creation, access, iteration, avoiding KeyError, merging dicts, defaultdict, OrderedDict, and the ** unpacking operator.
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📋 🔒 Subscribe
Module 19
Lists — Methods and Operations
Master every list method — append, extend, insert, pop, remove, sort with key functions, copy vs reference, any/all, …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🧩 🔒 Subscribe
Module 20
List Comprehensions
Write concise, Pythonic list comprehensions with filters, ternary expressions, nested loops, and dict/set/generator expressions. Avoid common traps like …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
✂️ 🔒 Subscribe
Module 21
List Slicing and groupby
Master Python's slice syntax with step arguments, the slice() object for reusable slices, list shifting and rotation, zip …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔍 🔒 Subscribe
Module 22
filter() and filterfalse()
Use filter() to select elements based on a predicate function. Understand lazy evaluation, filter with None, short-circuit with …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🏔️ 🔒 Subscribe
Module 23
heapq — Priority Queues
Use Python's heapq module to efficiently find the N largest or smallest items, build a min-heap, push and …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📦 🔒 Subscribe
Module 24
Tuples
Master Python tuples — creation, immutability, packing and unpacking, indexing, slicing, built-in functions, and how they differ from …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⌨️ 🔒 Subscribe
Module 25
Basic Input and Output
Master Python's print() function, reading and writing files with open(), stdin, input() for user prompts, and controlling print …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔗 🔒 Subscribe
Module 26
Linked Lists
Understand how linked lists work — nodes, references, and traversal. Build a Node class, implement a singly linked …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📁 🔒 Subscribe
Module 27
os.path — File Path Manipulation
Use os.path to join, split, check, and manipulate file paths in a cross-platform way — works correctly on …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔁 🔒 Subscribe
Module 28
Iterables and Iterators
Understand the difference between iterables, iterators, and generators — how iter() and next() work, StopIteration, single-use vs reusable …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⚡ 🔒 Subscribe
Module 29
Functions
Master Python functions — defining, calling, default arguments, *args/**kwargs, keyword-only parameters, lambda expressions, closures, recursion, and return values.
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📝 🔒 Subscribe
Module 30
Functions with List Arguments
Understand how lists are passed to functions — mutation vs rebinding, defensive copying, designing functions that work with …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔧 🔒 Subscribe
Module 31
Functional Programming — map, reduce, filter
Apply functional programming techniques in Python — map() to transform, filter() to select, reduce() to accumulate, and partial() …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🎨 🔒 Subscribe
Module 32
Decorators
Use Python decorators to add behaviour to functions and classes — function decorators, decorator factories with arguments, @functools.wraps, …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🏗️ 🔒 Subscribe
Module 33
Classes
Master Python classes — __init__, class vs instance variables, methods, inheritance, super(), @classmethod, @staticmethod, @property, and multiple inheritance.
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🖊️ 🔒 Subscribe
Module 34
String Formatting
Master Python's three string formatting systems — % operator, str.format(), and f-strings. Learn alignment, padding, float precision, number …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔤 🔒 Subscribe
Module 35
String Methods
Master Python's string methods — case conversion, split/join/replace, strip, find/count, startswith/endswith, testing content with is-methods, and the string …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔄 🔒 Subscribe
Module 36
Using Loops Within Functions
Understand how return works inside loops, how to use for/else to distinguish 'found' from 'exhausted', early exits for …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📦 🔒 Subscribe
Module 37
Importing Modules
Master Python's import system — import, from...import, aliasing with as, __all__, wildcard imports and why to avoid them, …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🗂️ 🔒 Subscribe
Module 38
Modules vs Packages
Understand the difference between a module (a single .py file) and a package (a directory of modules). Learn …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🧮 🔒 Subscribe
Module 39
The math Module
Use Python's math module for rounding (floor/ceil/trunc), trigonometry, logarithms, infinity, NaN, and mathematical constants — and understand the …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🌀 🔒 Subscribe
Module 40
Complex Numbers and cmath
Work with complex numbers in Python — the j notation, real/imag/conjugate, arithmetic, abs(), the cmath module for sqrt/trig/log …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🗃️ 🔒 Subscribe
Module 41
collections Module
Use Python's collections module for specialised data structures — Counter for frequency counting, defaultdict to avoid KeyError, OrderedDict …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⚙️ 🔒 Subscribe
Module 42
The operator Module
Use the operator module to replace lambdas with faster, named functions — itemgetter for sorting/grouping by dict or …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📄 🔒 Subscribe
Module 43
The json Module
Serialize Python objects to JSON and deserialize JSON back to Python — using dumps/loads for strings and dump/load …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🗄️ 🔒 Subscribe
Module 44
sqlite3 — Embedded Database
Use Python's built-in sqlite3 module to create and query an embedded SQL database — connect, create tables, insert …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🖥️ 🔒 Subscribe
Module 45
The os Module
Use Python's os module for portable operating-system operations — creating and removing directories, listing contents, walking directory trees, …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⛓️ 🔒 Subscribe
Module 46
The itertools Module
Master Python's itertools for efficient lazy iteration — combinations/permutations, chain, cycle, repeat, takewhile/dropwhile, accumulate, islice, product, and groupby.
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🎲 🔒 Subscribe
Module 47
The random Module
Generate random numbers and make random selections — randint, randrange, random, uniform, choice, sample, shuffle, seed for reproducibility, …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔩 🔒 Subscribe
Module 48
functools — Higher-Order Function Tools
Use functools to write cleaner, more efficient Python — partial() for pre-filling arguments, @lru_cache for memoisation, reduce() for …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
✂️ 🔒 Subscribe
Module 49
Indexing and Slicing
Master Python's slice syntax in full — start:stop:step, negative indices, reversal with [::-1], slice assignment to replace subsets …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
⚡ 🔒 Subscribe
Module 50
Generators
Create memory-efficient iterators with generator functions (yield) and generator expressions. Master infinite sequences, yield from for delegation, generator …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🗺️ 🔒 Subscribe
Module 51
map() — Transform Iterables
Use map() to apply a function to every element of an iterable — with named functions, lambdas, or …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔢 🔒 Subscribe
Module 52
Exponentiation
Master Python exponentiation — the ** operator, pow() with two and three arguments, math.sqrt and cmath.sqrt, fractional exponents …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔎 🔒 Subscribe
Module 53
Searching in Python
Search sequences efficiently — the in operator across all collection types, list/tuple .index(), string .find() vs .index(), searching …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📊 🔒 Subscribe
Module 54
Sorting, min() and max()
Master Python's sorting tools — sorted() vs .sort(), min/max with key= and default=, sorting dicts by key or …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔢 🔒 Subscribe
Module 55
Counting Occurrences
Count elements efficiently — Counter.most_common(), list.count() and tuple.count() for single values, str.count() for substrings, and manual counting patterns …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
🔍 🔒 Subscribe
Module 56
Regular Expressions
Use Python's re module to match, search, find, replace, and split strings with patterns — raw strings, groups, …
5 Topics 5 Pitfalls 5 MCQ 5 Predict
Subscriber onlyUnlock
📋 🔒 Subscribe
Module 57
Copying Data — Shallow vs Deep
Understand shallow and deep copies — why b = a just copies a reference, when [:] or .copy() …
4 Topics 3 Pitfalls 5 MCQ 3 Predict
Subscriber onlyUnlock
🔐 🔒 Subscribe
Module 58
Context Managers — the with Statement
Use Python context managers for safe resource management — the with statement, __enter__ and __exit__, writing custom managers …
4 Topics 4 Pitfalls 5 MCQ 3 Predict
Subscriber onlyUnlock
🏷️ 🔒 Subscribe
Module 59
__name__ and Script vs Module
Use __name__ to write code that behaves differently when run directly vs imported, inspect function/class/module names, set up …
4 Topics 3 Pitfalls 5 MCQ 3 Predict
Subscriber onlyUnlock
📦 🔒 Subscribe
Module 60
Python Packages and pip
Understand how Python packages work — installing, upgrading, uninstalling and listing packages with pip, requirements.txt, virtual environments, and …
5 Topics 4 Pitfalls 5 MCQ 3 Predict
Subscriber onlyUnlock
⌨️ 🔒 Subscribe
Module 61
Command-Line Arguments — argparse
Build professional command-line interfaces with argparse — positional and optional arguments, defaults, help text, type conversion, mutually exclusive …
5 Topics 4 Pitfalls 5 MCQ 3 Predict
Subscriber onlyUnlock
🖥️ 🔒 Subscribe
Module 62
The subprocess Module
Run external commands and programs from Python using subprocess — subprocess.run(), check_call(), capturing output, handling errors, communicating with …
5 Topics 4 Pitfalls 5 MCQ 3 Predict
Subscriber onlyUnlock