NoneFalse- Zero of any numeric type (0, 0.0)
- Empty strings -
'' - Empty sequences -
[],() - Empty mapping -
{}
- x
andy - x
ory notx
| Operator | Meaning |
|---|---|
| < | strictly less than |
| <= | less than or equal |
| > | strictly greater than |
| >= | greater than or equal |
| == | equal |
| != | not equal |
| is | object identity |
| is not | negated object identity |
- int
- 32 bits of precision
- float
- Numeric literals with a decimal point
- long
- Integers have unlimited precision
- Suffixed with
Lorl, useLto avoid confusion with the number 1
- complex
- Suffixed with
Jorj
- Suffixed with
- Enclosed in either single or double quotes
- Can be prefaced with
ufor unicode strings (u'abc',u"def") - Splicing
- len()
- Enclosed in square brackets
[a, b, c]
- Optionally enclosed in parentheses
a, b, cor(a, b, c)- Empty tuples must have parentheses
() - A single tuple value must have a trailing comma
(a,)