Foundations — Tuples — immutability, use cases
Before you can understand that sentence, you need to understand what a box, a name, a position, and "glued shut" actually are. This page builds each one from nothing, in the order they depend on each other. Never skip ahead — every idea here is used by the next.
Symbol 0 — a value
Picture one thing sitting on a table. That's a value. It has no name yet — it's just there.
The parent page mixes many values together ((255, 128, 0)), so we must first be crystal-clear on what one of them is.
Symbol 1 — a name and the = sign
When you write:
point = (3, 4)the = is not the "equals" from maths. In maths = asks a question ("are these the same?"). In Python = gives a command: "take the thing on the right, and make the name on the left point at it."

Why does the parent topic need this? Because immutability is a rule about the value (the box), not the name (the tag). Later we'll rebind the tag freely while the box stays frozen — you can't see why that isn't a contradiction unless you already separate tag from box.
Symbol 2 — ordered and the index
An ordered collection means each item has a fixed position, and positions are numbered starting from 0.

Look at the figure: three boxes in a row, tagged 0, 1, 2 underneath (never 1, 2, 3). The little [ ] after a name is the "reach into position" tool.
Why does the topic need this? "Ordered" and "index" are how the parent says point[0] is 3. Without the from-zero picture, every worked example mis-reads.
Symbol 3 — parentheses () vs the comma ,
The parent page's biggest trap: what actually builds a tuple?
a = (3) # NO comma → just the number 3, parens only "hug" it
b = (3,) # comma → a tuple with one item
c = 3, 4 # comma, NO parens → still a tuple (3, 4)Picture the comma as glue between boxes and the parentheses as a cardboard tray you may set the glued row into. Glue is what makes it "one thing"; the tray is optional packaging.
Why the topic needs this: the one-element tuple (42,) and the swap trick a, b = b, a are pure comma-magic. If you think parentheses do the work, both look like nonsense.
Symbol 4 — mutable vs immutable
Now the heart of it.

Look at the figure — two objects side by side:
- List (left, open box): you can slide items in and out. Mutable.
- Tuple (right, sealed & taped): you may peek through the window (read), but the tape stops any edit. Immutable.
Symbol 5 — a hash
The parent page claims tuples can be dictionary keys "because they're hashable." Here is what that word means, from zero.
Picture handing a librarian a book; she instantly reads a shelf-number off its cover and files it. To find it later she reads the same cover, gets the same shelf-number, and walks straight to it.
This is exactly the parent's chain "immutable → hashable → valid dict key." You now hold every link. Details live in Hashing in Python, used by Dictionaries — keys and values and Sets — hashing & uniqueness.
Symbol 6 — packing and unpacking

The figure shows it both ways: three loose values squeeze into one tuple (pack, arrows inward), then that tuple bursts back out onto three names (unpack, arrows outward). The count must match: 3 items → 3 names.
Why the topic needs it: return min(nums), max(nums) packs, and lo, hi = min_max(...) unpacks. The swap a, b = b, a packs the right side into a temporary tuple, then unpacks it — that's the whole trick. See Functions — return values.
How these feed the topic
Read it top-down: values need names; names plus ordering give indexing; the comma plus freezing give immutability; immutability enables hashing; and packing/unpacking is how tuples flow in and out of functions. All arrows land on the topic.
Equipment checklist
Test yourself — cover the right side, answer, then reveal.
In Python, does = ask a question or give a command?
Is a name a container that holds a value, or a tag pointing at one?
What index does the FIRST item of a tuple have?
0 — positions count from zero.For an -item tuple, what index is the LAST item?
What actually builds a tuple — the parentheses or the comma?
Write a one-element tuple containing 42.
(42,) — the trailing comma is mandatory.Define "immutable" in one sentence.
Does t = t + (9,) modify the old tuple?
t. The old value is untouched.What is a hash, in plain words?
Why must a dictionary key be immutable?
What is "unpacking"?
x, y = t.Connections
- Lists — mutability, methods — the mutable box these foundations contrast against.
- Mutable vs Immutable objects — Symbol 4 is the seed of this whole idea.
- Hashing in Python — Symbol 5 in full detail.
- Dictionaries — keys and values — where hashable tuples pay off.
- Sets — hashing & uniqueness — same hashing requirement.
- Functions — return values — packing/unpacking in action.
- Yeh foundations Hinglish mein →