Self-written Python notes — from first print() to Big-O, hash maps, graphs, and dynamic programming. Every note here is my own rewrite while I learned the topic, not copied from any single course or book, with a matching practice set for every section.
I learn by shipping, not by watching passively — this repo is the paper trail of that.
python-mastery/
├── notes/ ← one folder per section, files numbered in learning order
└── practice/ ← practice questions + solutions, mirrored to the same sections
| Section | Topics | Practice |
|---|---|---|
| Fundamentals | 16 notes — browse | Practice |
| Environment & Setup | 4 notes — browse | Practice |
| Lists, Loops & Sequences | 11 notes — browse | Practice |
| Dictionaries, Sets & Imports | 7 notes — browse | Practice |
| Error Handling | 5 notes — browse | Practice |
| Classes & Objects | 5 notes — browse | Practice |
| OOP — The Four Pillars | 5 notes — browse | Practice |
| Data Structures & Algorithms | 18 notes — browse | DSA Overview / Searching & Sorting / Graphs & Trees / Dynamic Programming |
Fundamentals (16 topics)
- Python Overview — What It Is & Where It's Used in Industry
- Python Variables — Declaration & Naming Conventions
- Python print() Function — Output & Arguments
- Python Data Types — Dynamic Typing & Built-in Types
- Python type() & isinstance() — Checking Variable Types
- Python Strings — Quotes, Indexing & Immutability
- Python String Concatenation & Interpolation — + Operator & f-strings
- Python String Slicing — start, stop & step
- Python Common String Methods — upper, strip, split & more
- Python Integers & Floats — arithmetic, conversion & rounding
- Python Augmented Assignments — +=, -=, =, *= & more
- Python Conditionals — if, elif, else & comparison operators
- Python Truthy/Falsy & Boolean Operators — and, or, not & short-circuiting
- Python Functions — built-ins, def, parameters, arguments & return
- Python Scope — the LEGB rule, global & nonlocal
- Python Master Revision — The Complete Recap Sheet
Environment & Setup (4 topics)
Lists, Loops & Sequences (11 topics)
- Python Lists — Ordered, Mutable Sequences
- Python List Methods — append, pop, sort & More
- Python Tuples — Ordered, Immutable Sequences
- Python Tuple Methods — count, index & sorted()
- Python Loops — for, while, break, continue & else
- Python range() — Generating Sequences of Integers
- Python Ranges in Loops — start, stop, step & list()
- Python enumerate() & zip() — Index Tracking and Parallel Iteration
- Python List Comprehensions & filter(), map(), sum() — Concise List Work
- Python Lambda Functions — Anonymous Inline Functions Done Right
- Python Loops & Sequences Revision — The Complete Recap Sheet
Dictionaries, Sets & Imports (7 topics)
- Python Dictionaries — Key-Value Pairs, Access & Core Methods
- Python Looping Over Dictionaries — keys, values, items & enumerate
- Python Sets — Unique, Unordered Collections & Set Operations
- Python Standard Library & Imports — import, as, from & main
- Python ** Dictionary Unpacking — Passing a Dict as Keyword Arguments
- Python Regex Basics — http://re.search() for Pattern Matching
- Python Dictionaries, Sets & Imports Revision — The Complete Recap Sheet
Error Handling (5 topics)
- Python Common Error Messages — SyntaxError, NameError, TypeError, IndexError, AttributeError
- Python Debugging Techniques — print(), f-strings, pdb & IDE Debuggers
- Python Exception Handling — try / except / else / finally
- Python raise Statement — Throw, Re-raise, Custom & Chained Exceptions
- Python Error Handling Revision — The Complete Recap Sheet
Classes & Objects (5 topics)
- Python Classes & Objects — Blueprints, init, self, Attributes & Methods
- Python Attributes & Methods — Instance vs Class Attributes & Dot Notation
- Python Special / Dunder Methods — init, len, str, eq & Friends
- Python Dynamic Attribute Handling — getattr, setattr, hasattr, delattr & dir
- Python Classes & Objects Revision — The Complete Recap Sheet
OOP — The Four Pillars (5 topics)
- Python OOP & Encapsulation — Public, _Protected & __Private Attributes
- Python Getters, Setters & Properties — @property, .setter & .deleter
- Python Inheritance — Subclass, super(), Override & Multiple Inheritance
- Python Polymorphism — Same Method Name, Different Behavior (Duck Typing & Inheritance)
- Python OOP Revision — The Complete Four-Pillars Recap Sheet
Data Structures & Algorithms (18 topics)
- Algorithms & Big O Notation — Time & Space Complexity Cheat Sheet
- Problem-Solving Techniques — How to Approach Algorithmic Challenges (UPI Framework + Pseudocode)
- Static vs Dynamic Arrays — Fixed Size vs Auto-Resizing (and Python Lists)
- Stacks & Queues — LIFO vs FIFO (push/pop & enqueue/dequeue)
- Singly & Doubly Linked Lists — Nodes, Head/Tail, Insert/Remove Complexity
- Maps, Hash Maps & Sets — ADTs, Hashing, Collisions & Python dict/set
- Linear Search vs Binary Search — O(n) Scan vs O(log n) Halving
- Data Structures Revision — The Complete Recap Sheet (Algorithms, Arrays, Stacks, Queues, Linked Lists, Hash Maps & Sets)
- Divide & Conquer + Merge Sort — Recursion, Splitting & O(n log n) Sorting
- Searching & Sorting Algorithms Revision — Linear/Binary Search + Divide & Conquer/Merge Sort Recap
- Graphs in Computer Science — Nodes, Edges & the 7 Graph Types You Must Know
- BFS vs DFS — Breadth-First & Depth-First Search (Queues, Stacks & Graph Traversal)
- Adjacency Matrix vs Adjacency List — Two Ways to Represent a Graph in Code
- Trees & Tries — Binary Trees, BSTs, Prefix Trees & the Vocabulary of Hierarchies
- Priority Queues & Heaps — Min-Heaps, Max-Heaps, heapq & Why the Smallest/Largest Element Is Always One Pop Away
- Graphs & Trees Revision — Graphs, BFS/DFS, Adjacency Representations, Trees, Tries, Priority Queues & Heaps Recap
- Dynamic Programming — Memoization, Tabulation & Turning Exponential Problems into Linear Ones
- Dynamic Programming Revision — Memoization, Tabulation & the Two DP Conditions Recap
- Follow the folders in order (01 → 08) if you're learning Python front to back.
- Each "Revision" file at the end of a section is a complete recap sheet — use it to self-test before moving on.
- Section 08 (Data Structures & Algorithms) is the DSA track — arrays, stacks/queues, linked lists, hash maps, searching/sorting, graphs, trees, heaps, and dynamic programming, in that order.
See REFERENCES.md for the sources consulted while writing these notes.
Released under the MIT License.