Courses
Python Advanced: Code That Scales Past Your Own Laptop
Check Yourself: Data That Doesn't Fit in Memory
Five scenario questions on iterators, generators and context managers. If you miss more than one, go back to the lesson that covers it.
Course content
Join this Course
Sign in to save your progress.
-
Functions That Wrap Functions
-
Python Closures: Functions That Remember
-
Python Decorators in Real Code: Timing, Retry and Logging
-
-
-
Data That Doesn't Fit in Memory
-
Python Iterators: What a for Loop Actually Does
-
Python Generators and yield: One Piece at a Time
-
Python Context Managers: Clean Up Even When Things Fail
-
-
-
Catch Bugs Before You Run the Code
-
Python Type Hints Beyond the Basics: Optional, Union, Generics
-
Checking Types With mypy in a Real Project
-
-
-
Doing More Than One Thing at a Time
-
Python Concurrency Basics: Threads, Processes or asyncio?
-
Python asyncio: Wait for Many Things Without Waiting Longer
-
-
-
Ship It, Then Make It Fast
-
Packaging a Python Project With pyproject.toml
-
Profiling Python Code: Measure Before You Optimize
-
-
- Final Check: Python Advanced
1.
A function counts the rows of its input, then sums them in a second loop. You pass it zip(a, b). What happens?
2.
You have a 20 GB log file and need only the lines with ERROR. Which approach works?
3.
What happens when you call a generator function, like gen = countdown(3)?
4.
In a @contextmanager function, you forgot try/finally around yield. An error happens inside the with block. What happens to the clean-up after yield?
5.
Your context manager's __exit__ returns True for every error. What is the effect?
About
Five scenario questions on iterators, generators and context managers. If you miss more than one, go back to the lesson that covers it.
- Duration
- 5 min
- Last update
- 09/03/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.