A Python variable is just a name pointing at a value — and the value always knows its own type.
1 No Declarations
Write age = 25 and you are done — no int keyword, no semicolon; Python figures the type out.
2 The Core Four
int for whole numbers, float for decimals, str for text in quotes, bool for True and False.
3 Syntax Is Minimal
Statements end at the line break, and blocks open with a colon followed by an indented body.
4 Comments with #
Everything after # on a line is ignored — use it to leave notes for human readers.
Names, values and types
No Declarations1Write age = 25 and you are done — no int keyword, no semicolon; Python figures the type out. The Core Four2int for whole numbers, float for decimals, str for text in quotes, bool for True and False. Syntax Is Minimal3Statements end at the line break, and blocks open with a colon followed by an indented body. Comments with #4Everything after # on a line is ignored — use it to leave notes for human readers. 4 building blocks make up Names, values and types
Python variables are labels, not boxes. Play the script and watch names point at typed values.
Drag to orbit the scene. Press Play to watch memory in action.
Step through a tiny program and watch one value of each type appear — then let type() introduce them.
mainage points to 25 — an int, a whole number without a decimal point.
Console
output appears as the program runs…
Click a literal, then click the type it creates.
5 conceptsTap a card to expand ?25drops into place
?3.14drops into place
?"Ada"drops into place
?Truedrops into place
?# notedrops into place
What happens when text meets numbers? Type your guess, one line per line.
Your predicted output — one line per console line
Hint: "5" + "5" glues two texts into "55". int("5") converts text into the number 5 before adding.
01A variable is only a name; the object it points to carries the type.
02int = whole numbers, float = decimals, str = text, bool = True or False.
03Types are dynamic: the same name can point to an int now and a str later.
04int("5") converts text to a number — but "5" + "5" just glues strings.
05Blocks open with a colon and are marked by indentation; # starts a comment.