// blog

Articles

// Data Structures
Building Lists and Sets the Short Way

The idea
You know the syntax. Now let's put it to work — with lists and sets, across real scenarios.
The only difference between a list comprehension and a set comprehensi…

06 May 2026 2 min read files [1] comments [0] 18 views
// Data Structures
Building Dicts the Short Way

The idea
Same concept as list and set comprehensions — but now you're building a dict.
Every element produces a key-value pair instead of just a value.
The syntax
{key_e…

06 May 2026 2 min read files [1] comments [0] 18 views
// Data Structures
Comprehensions Mini Project — Even Numbers

What you're building
The even numbers filter is back. Same input, same output — but the function is now one line.
This is what comprehensions are for: replacing a loop-and…

06 May 2026 1 min read files [1] comments [0] 18 views
// Data Structures
Files: Where Your Data Lives After the Program Stops

The problem...
Every program you've written so far has the same limitation.
You run it. You enter data. It processes. It prints.
Then you close it — and everything is gon…

06 May 2026 3 min read files [0] comments [0] 18 views
// Data Structures
How Python Reads a File

The idea
You have a file on your computer. Python needs to find it, open it, and read what's inside.
Three methods. One pattern. All the same with open() block.
Where to put yo…

06 May 2026 2 min read files [2] comments [0] 18 views
// Data Structures
Write, Overwrite, Append: How Python Handles File Output

The idea
Reading gets data out of a file. Writing puts data in.
Python gives you two distinct modes for this — and the difference between them matters.
write() — cr…

06 May 2026 2 min read files [1] comments [0] 18 views