Literals
● Intermediate2 minSpec 1.7
How each kind of value is written in code: numbers, text, characters and the rest.
Spec 1.7 · learn it in Data Types.
| Kind | Examples |
|---|---|
| Integer | 42, 1_000_000, 0xff (hex), 0o644 (octal), 0b1010 (binary) |
| Float | 3.14, 1e9, 2.5e-3 |
| Bool | true, false |
| Char | 'a', 'क', '\n' |
| String | "Hello, {name}!" |
| Multi-line string | """ … """ (common leading indentation is removed) |
| Raw string | r"C:\path\{not interpolated}" |
| Empty optional | none |