Sitemap
Code Like a Pro, Sleep Like a Baby

Learn exactly how to build high quality software from inception to production with confidence.

From One to Many

Collections of variables

2 min readSep 29, 2025

--

In the last article, you set up your coding lab with VS Code. Before that, you learned about variables — the way computers remember single pieces of information.

But life rarely comes in singles.

  • You don’t just have one expense — you have many.
  • You don’t just store one ingredient — you store dozens.
  • You don’t just watch one Netflix show — you watch a whole library.

To handle this, programming gives you collections of variables: structures that let you manage many values together.

Why Collections?

A single variable can store:

expense = 20

But what if you have 10 expenses?

expense1 = 20
expense2 = 35
expense3 = 12
...

This quickly becomes chaos. You need a way to group related values under one name. Collections solve this.

Types of Collections

1. Lists (or Arrays)

A list stores values in order.

expenses = [20, 35, 12, 50]
print(expenses[0]) # First expense: 20

Think of it as a row of lockers, each numbered and holding a value.

2. Dictionaries (or Maps)

A dictionary stores key–value pairs.

cake = {…

--

--

Code Like a Pro, Sleep Like a Baby
Code Like a Pro, Sleep Like a Baby

Published in Code Like a Pro, Sleep Like a Baby

Learn exactly how to build high quality software from inception to production with confidence.

0xRomesh
0xRomesh

Written by 0xRomesh

I share my journey, explorations and tech wisdom. (Φ, θ, AI, Life, Quantum, Spirituality, Calm Tech)

No responses yet