7 Python Gotchas That Trip Up Interviews
Seven Python gotchas that trip up interviews as what-does-this-print puzzles: mutable defaults, late binding, is vs ==, round()…
Reading and Writing Files in Python
Read and write files in Python: open, modes r w a, read vs readline, encodings, pathlib, CSV and…
Python lambda, map, filter and reduce Explained
Python lambda, map, filter and reduce explained with real code and output: sort keys, lazy iterators, reduce steps…
Python Decorators Explained Step by Step
Python decorators explained step by step: closures, the @ syntax, wraps, decorators with arguments and lru_cache, with real…
Python Context Managers and the with Statement
Python context managers and the with statement explained: __enter__, __exit__, @contextmanager and suppress, with real code and output.
Python Exception Handling: try, except, finally
Python exception handling explained: try, except, else, finally, raise and custom exceptions, with real code, output and common…
Python Inheritance and Dunder Methods Explained
Python inheritance and dunder methods explained: super(), overriding, __str__ vs __repr__ and operators, with real code and output.
Python Classes and Objects for Beginners
Python classes and objects for beginners: __init__, self, methods, class vs instance attributes, with real code and output…
Python Iterators and Generators Explained
Python iterators and generators explained: iter, next, yield, lazy evaluation and pipelines, with real code, output and practice…
Shallow Copy vs Deep Copy in Python
Shallow copy vs deep copy in Python: what each does, how nested lists and dicts behave, and when…