← Courses
LANG PY2 · 3 credits
Course Outline
Advanced Python
Level up from Python for Beginners to production-grade Python. You will master comprehensions, advanced function tools, classes and dunder methods, generators, decorators, the standard library, regex, robust file and error handling, and the performance idioms that make code truly Pythonic.
What you will learn
- ✓Replace loop boilerplate with list, dict, and set comprehensions, including conditional and nested forms
- ✓Write flexible functions with *args, **kwargs, defaults, lambdas, and higher-order patterns like sorted(key=...)
- ✓Design classes with __init__, methods, dunder methods, and inheritance, and know when objects beat dicts
- ✓Build lazy data pipelines with iterators, generators, and yield
- ✓Write and read decorators built from closures, and apply practical ones like timing and caching
- ✓Use the standard library power tools: collections, itertools, functools, math, re, pathlib, and json
- ✓Handle files and errors safely with context managers and custom exceptions
- ✓Choose the right data structure by big-O cost and solve classic interview-style problems cleanly
Course outline
Unit 1Comprehensions
- 1-1List comprehensions5 checks · 12 min
- 1-2Filtering with if, transforming with if/else4 checks · 11 min
- 1-3Dict, set, and nested comprehensions5 checks · 12 min
Unit 2Functions, deeper
- 2-1*args and **kwargs5 checks · 12 min
- 2-2Default values and the mutable default trap4 checks · 10 min
- 2-3Lambdas, sorted key=, and higher-order functions5 checks · 14 min
Unit 3Object-oriented Python
- 3-1Classes and __init__5 checks · 13 min
- 3-2Methods, and when objects beat dicts4 checks · 13 min
- 3-3Dunder methods: __repr__, __eq__, __len__4 checks · 13 min
- 3-4Inheritance4 checks · 12 min
Unit 4Iterators and generators
- 4-1The iteration protocol5 checks · 12 min
- 4-2Generators, yield, and lazy pipelines4 checks · 15 min
Unit 5Closures and decorators
- 5-1Closures: functions that remember5 checks · 12 min
- 5-2Decorators5 checks · 15 min
Unit 6Standard library power tools
- 6-1collections: Counter, defaultdict, deque5 checks · 14 min
- 6-2itertools: ready-made iteration tools4 checks · 11 min
- 6-3functools and math4 checks · 11 min
Unit 7Regular expressions
- 7-1re basics: patterns, classes, quantifiers5 checks · 14 min
- 7-2Groups, findall, sub, and a lookahead5 checks · 13 min
Unit 8Files, JSON, and errors done right
- 8-0Files: reading and writing from zero3 checks · 11 min
- 8-1pathlib and context managers4 checks · 12 min
- 8-2JSON in and out4 checks · 12 min
- 8-3Exceptions done right4 checks · 13 min
Unit 9Pythonic style and performance
- 9-1Idioms that mark you as fluent5 checks · 13 min
- 9-2Big-O: choosing list, dict, or set4 checks · 12 min
Unit 10DSA warm-up capstone
- 10-1Two-sum and the dict trick5 checks · 15 min
- 10-2Capstone: stacks, anagrams, windows4 checks · 14 min
Practice while you learn
Use Hack University's public online code editor when you want to run code online before committing to the full curriculum. The browser compilers are free for quick syntax checks, exercises, and interview practice in an isolated sandbox environment.