September 2026
1051 pages
35h 4m
English
You know the term operator from math, where it denotes a formula character that stands for a certain arithmetic operation. In Python, for example, you can use operators to combine two numeric values into an arithmetic expression:
>>> 1 + 23
The values to which an operator is applied—in this case, 1 and 2—are called operands. There are also operators for other data types. For example, + can be used to join two strings:
>>> "A" + "B"'AB'
So in Python, the meaning of an operator depends on which data type it is applied to.
We’ll limit ourselves in this section to the operators +, -, *, and <, which are sufficient to explain the underlying principle. In the following examples, the three references ...
Read now
Unlock full access