Courses
Python Intermediate: Write Code You Won't Be Embarrassed to Share
Check Yourself: Shorter Code That Still Says What It Does
Five scenario questions on comprehensions and when to use a plain loop instead. If you miss more than one, go back to the two lessons.
Course content
Join this Course
Sign in to save your progress.
-
Set Up Projects That Don't Break Each Other
-
Python Virtual Environments and pip: One Project, One Environment
-
Pinning Python Dependencies With requirements.txt
-
-
-
Organize Code Other People Can Read
-
Python Modules and Packages: Splitting One Big File
-
Python Imports: Why ModuleNotFoundError Keeps Happening
-
Python Classes: When a Dictionary Is No Longer Enough
-
-
-
Work With Real Files
-
Python File Handling: Open, Read, Write, and Always Use with
-
Python pathlib: Stop Building File Paths by Hand
-
Reading, Cleaning and Writing CSV Data in Python
-
-
-
Shorter Code That Still Says What It Does
-
Python Comprehensions: Lists, Sets and Dictionaries
-
When a Comprehension Should Be a Plain Loop
-
-
-
Prove It Works Before Someone Else Finds Out
-
Python Testing Basics With pytest
-
Debugging Python With print, logging and pdb
-
-
- Final Check: Python Intermediate
1.
What does [p for p in prices if p >= 1000] do with a price of 500?
2.
You want "big" or "small" for every price, keeping all items. Which is correct?
3.
You build by_sku = {p["sku"]: p for p in products} from 300 products, but by_sku only has 298 entries. What happened?
4.
A teammate wrote [send_email(c) for c in customers]. Why is a plain loop better here?
5.
You convert a list of amounts with [float(x) for x in raw], and one value is "N/A". You need to keep the good values and know which ones failed. What fits best?
About
Five scenario questions on comprehensions and when to use a plain loop instead. If you miss more than one, go back to the two lessons.
- Duration
- 5 min
- Last update
- 09/19/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.