Expressions, operators, and data types
Python expressions are built from operators and operands. In Chapter 2, Simple Data Types, we introduced some of the basics of number and string operands, and looked at the variety of operators. We'll summarize the details here so that we can address some additional operator features.
Our numeric operands form a "tower", with types including:
Type |
Cardinality |
Number of operators |
---|---|---|
|
Ideally, the most distinct values built from a pair of irrational numbers, ∞×∞. Actually ( |
The fewest operators; only arithmetic, some built-in functions, and the |
|
Ideally this is a rational number union with irrational numbers (∞+∞). Actually closer to distinct values. |
Arithmetic operators, comparisons. Many additional |
|
Ideally, these are rational numbers (∞×∞). Actually only limited by available memory to represent two integers. |
Arithmetic operators... |