Courses
Python Intermediate: Write Code You Won't Be Embarrassed to Share
Check Yourself: Organize Code Other People Can Read
Five scenario questions on modules, packages, imports and classes. 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.
-
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.
Your pricing.py has test prints at the bottom, and they run every time main.py imports it. What is the right fix?
2.
python tools/report.py fails with "No module named 'shop'", but shop/ is right there in the project folder. What is the cleanest fix?
3.
After you created a file called random.py in your project, random.randint suddenly "has no attribute". Why?
4.
Your code passes an order dictionary to ten functions, and several of them check the status rules slightly differently. What does moving to a class give you?
5.
You wrote class Cart: def __init__(self, items=[]): and now every new cart already contains items from other carts. Why?
About
Five scenario questions on modules, packages, imports and classes. If you miss more than one, go back to the lesson that covers it.
- Duration
- 5 min
- Last update
- 09/17/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.