// blog
Articles
All
Basics
Control Flow
Functions
Data Structures
Modules & Packages
Projects
Object-oriented programming
|
↑ oldest first
↓ newest first
// Data Structures
File Handling Mini Project — Shopping List
What you're building
The shopping list is back. Again.
Version 1 used a list. Version 2 added quantity and price with a dict.
Version 3 adds persistence. The list saves to a fi…
→
// Data Structures
Common File Handling Mistakes
You've covered file handling from every angle. Here are the mistakes that show up most often — and how to fix them.
1. Not closing the file — or forgetting with open(…
→
// Data Structures
File Handling — The Full Picture
You've covered file handling from every angle. Before moving on, here's everything in one place.
// The pattern — always
with open("file.txt", "r", encoding="utf-8") as f:…
→
// Data Structures
The Foundation Is Set
Stop for a second.
Look at what's in your kit now.
Lists that grow, shrink, sort, and remember. Dicts that give you any value by name — instantly. Tuples that hold fixed d…
→