File I/O & Working with CSV and JSON in Python
Beginner · 30 minutes · 100 points
In this foundational lab you will practice core Python file handling skills: reading and writing plain text files, parsing and creating CSV files using the csv module, and loading and dumping JSON data using the json module. By the end you will have built a small data pipeline that reads raw text, transforms it into structured CSV and JSON formats, and writes the results to disk.
What you’ll learn
- Read and write plain text files using Python's built-in open() function
- Parse and write structured data using Python's csv module
- Load, manipulate, and serialize data using Python's json module
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 3 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: python:3.12-slim
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
Topics: python, file-io, csv, json, data-processing
Create a free account to start this lab.