Basics
Values
Start with several built-in values. Python does not require declarations before binding these names, and each value is still an object with a type.
Source
text = "python"
count = 3
ratio = 2.5
ready = True
missing = None
print(type(text).__name__)Output
strMethods and operators evaluate to new values. The original text, count, and ratio bindings remain ordinary objects you can reuse.
Source
print(text.upper())
print(count + 4)
print(ratio * 2)Output
PYTHON
7
5.0Boolean expressions combine facts, and None is checked by identity because it is a singleton absence marker.
Source
print(ready and count > 0)
print(missing is None)Output
True
TrueNotes
- Values are objects; names point to them and operations usually create new values.
- Use
is Nonefor the absence marker, not== None. - This overview introduces boundaries that later pages explain in detail.
See also
Run the complete example
Expected output
str
PYTHON
7
5.0
True
True
Execution time appears here after you run the example.