Foundations — f-strings — embedding expressions
Before you can read a single line of the parent note, you meet a pile of symbols and words: "...", f, { }, =, :, +, str(), .upper(), [0], "expression", "scope". If any of these is a fog to you, the parent note will feel like magic instead of logic. So we take them one at a time, each with a plain meaning, a picture, and the reason the topic needs it.
1. A string — text the computer stores literally
Picture text as beads on a wire — each bead is one character, and the two quote marks are the clips at each end that say "everything between us is just beads, don't try to run it."

The quotes are not part of the text. "Ada" is the three characters A, d, a. The quotes are just the fence.
See also Strings — literals and quotes.
2. A variable — a labelled box holding a value
Picture a box on a shelf with a sticky label. The label is the name (name, age). The thing inside is the value ("Ada", 36).

See also Variables and scope.
3. Scope — which boxes are visible right now
Picture a room: the boxes on the shelves in your room are reachable; boxes locked in another room are not. Code inside braces stands in the same room as the code around it.
4. An expression — code that produces a value
This is the most important foundation for the whole topic, so go slow.
Contrast it with a statement, which does something but need not hand you a value.
| You write | Is it an expression? | Value it becomes |
|---|---|---|
7 |
yes | 7 |
7 + 5 |
yes | 12 |
name |
yes | "Ada" |
word.upper() |
yes | "PYTHON" |
word[0] |
yes | "p" |
age = 36 |
no — it's an assignment statement | (nothing to hand back) |
Picture an expression as a juicer: you feed in code, one drop of juice (the value) comes out the bottom. An assignment is a filing action — it puts a folder away but produces no juice.

Related tools you'll see used as expressions:
- str() and type conversion —
str(...)is an expression. - print() function —
print(...)is where f-strings usually end up.
5. The building-block operators & accessors
These are small expression-makers the parent note drops in without ceremony.
Picture indexing as numbered parking spots along the string, starting at spot 0:

6. str() and "convert to text"
Picture a printing press: a number 36 goes in, and out comes a printed label reading 36 — same look, different material (text, not number).
See str() and type conversion and the older str.format() method.
7. The f, the { }, and the : — the three new marks
Now that every underlying idea exists, the three symbols the topic adds make sense.
Reading the substitution law (a note on LaTeX notation)
The parent note states the rule as a formula written in LaTeX, the language used to typeset maths on these pages. Two marks look scary but are harmless once named:
\text{...}just means "show these words in normal upright letters" (not italic maths letters). So\text{concat}displays the plain word concat.\Big( ... \Big)are simply big round brackets stretched tall so they wrap a long expression — ordinary parentheses, sized up.\dotsis the printed form of "...", meaning "and so on, the pattern continues."
With those decoded, here is the law:
8. Two edge cases you'll meet immediately
These are not new foundations, but they are marks that appear inside braces and confuse beginners the first time, so meet them now.
Prerequisite map
The diagram below is written in Mermaid, a tiny text language for drawing flowcharts. Read it like this: each box is a foundation, and an arrow A --> B means "you need A before B makes sense." Follow the arrows upward-to-downward toward the f-string at the bottom.
How to read it: start at any top box, follow each arrow — the thing the arrow points at depends on the thing it comes from. Everything eventually flows into "f-string."
Equipment checklist
Cover the right side and check you can answer each before reading the parent note.
What do the quote marks around a string actually do?
In age = 36, what does the single = mean?
What is a variable?
What is scope?
Give the one-sentence test for whether something is an expression.
Is x = 5 an expression? Why does it matter here?
{x = 5} errors.What is word[0] and what does it give for word = "python"?
"p".What does str(36) return, and how is it different from 36?
"36" (characters you display), which is no longer a number you can do arithmetic with.What does the f prefix switch on?
{ } as fill-in blanks holding expressions, not as literal characters.What does the : inside a brace introduce?
How do you print a literal { inside an f-string?
{{ to show one {, and }} to show one }.What does the !r conversion flag do, as in f"{name!r}"?
repr(value) instead of str(value), so a string is shown with its quotes, e.g. 'Ada'.Connections
- 1.2.13 f-strings — embedding expressions (Hinglish) — the parent idea in Hinglish.
- Strings — literals and quotes — §1, what quotes fence off.
- Variables and scope — §2, §3, boxes and reachability.
- str() and type conversion — §6, print-as-text.
- str.format() method — the older sibling of the substitution rule.
- Format specification mini-language — §7–§8, what lives after the
:and the!r/!s/!aflags. - print() function — where f-strings are usually sent.