Courses
Python Intermediate: Write Code You Won't Be Embarrassed to Share
Check Yourself: Work With Real Files
Five scenario questions on file handling, pathlib and CSV data. If you miss more than one, reread the lesson before moving on.
By Christopher R
Updated
5 min
PythonAutomation and ScriptingTesting and DebuggingObject-Oriented ProgrammingPackaging and Dependencies
Intermediate
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 script writes the daily summary with open("summary.txt", "w") inside a loop over 30 stores. At the end, the file only has the last store. Why?
2.
A CSV file shows "José" instead of "José" when your script reads it on a coworker's Windows laptop. What is the most likely fix?
3.
Your script opens Path("data.csv") and works from its own folder, but fails as a scheduled task. What is the reliable fix?
4.
An export has a customer named "Reyes, Ana" in quotes. Your script uses line.split(","), and every value after it is in the wrong column. What should you do?
5.
2 of 500 rows in an export have "N/A" in the amount column. Your total is going into a monthly report. What is the right handling?
About
Five scenario questions on file handling, pathlib and CSV data. If you miss more than one, reread the lesson before moving on.
- Duration
- 5 min
- Last update
- 09/18/2026
Was this helpful?
0
0
Comments
Sign in to commentNo comments yet.