// blog

Articles

// Data Structures
The Set: Unique Values, Nothing More

The problem...
You have a list of names. Some appear more than once.
attendees = ["Raven", "Wolf", "Raven", "Ghost", "Wolf", "Bull"]
You want only the unique names. No duplicat…

06 May 2026 2 min read files [0] comments [0] 18 views
// Data Structures
Using Sets in Your Code

The idea
You know what a set is and why it exists.
Now let's look at what you can actually do with one — adding, removing, checking, and comparing.
Adding and removing el…

06 May 2026 2 min read files [1] comments [0] 18 views
// Data Structures
Sets Mini Project — Attendance Tracker

What you're building
An attendance tracker. You have a fixed list of enrolled students. The user marks who showed up. At the end — present, absent, numbers.
What you need …

06 May 2026 1 min read files [1] comments [0] 18 views
// Data Structures
Comprehensions: A Shorter Way to Build Collections

The problem...
You want a list of squares for numbers 1 through 10.
The loop version works:
squares = []
for n in range(1, 11):
squares.append(n ** 2)
print(squares)
Ou…

06 May 2026 1 min read files [0] comments [0] 16 views
// 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