Page 142 - Beginning Programming with Pyth - John Paul Mueller
P. 142
Operators are the basis for both control and management of data within applications. You use operators to define how one piece of data is compared to another and to modify the information within a single variable. In fact, operators are essential to performing any sort of math- related task and to assigning data to variables in the first place.
When using an operator, you must supply either a variable or an expression. You already know that a variable is a kind of storage box used to hold data. An expression is an equation or formula that provides a description of a mathematical concept. In most cases, the result of evaluating an expression is a Boolean (true or false) value. The following sections describe operators in detail because you use them everywhere throughout the rest of the book.
Defining the operators
An operator accepts one or more inputs in the form of variables or expressions, performs a task (such as comparison or addition), and then provides an output consistent with that task. Operators are classified partially by their effect and partially by the number of elements they require. For example, a unary operator works with a single variable or expression; a binary operator requires two.
The elements provided as input to an operator are called operands. The operand on the left side of the operator is called the left operand, while the operand on the right side of the operator is called the right operand. The following list shows the categories of operators that you use within Python:
Unary Arithmetic Relational Logical