Getting StartedVariables, Types & Truthiness
All courses

Storing data

A variable binds a name to a value. No type declarations — Python infers types at runtime (which is convenient until 2am debugging).

name = "Ada"       # str
age = 36            # int
height = 1.70       # float
is_engineer = True  # bool

Quirk #2 — Truthiness: Empty containers ([], {}, "") and None are falsy. Everything else is truthy — even the number 0 is falsy, but the string "0" is truthy. Python is dramatic like that.

Use type(x) and bool(x) to inspect values.

Output
Press Run to execute your code.