Custom Search

Python: Operators

Input values are called operands.

An operation is an action or procedure which produces a new value from one or more operands.

An operator is a symbol that represents an operation. For example: +, x, /, *, //, **

 

There are two types of operators: unary and binary.

The unary operator operates only on one operand, for example 'negation' - changing the sign of a value.

The binary operator operates on two operands for example addition, subtraction, multiplication, division, exponentiation, etc.

Consider the expression 2 + 7

operands: 2 and 7

operator: +

The operator catagories:

Arithmetic Operators

Relational or Comparison Operators

Assignment Operators

Logical Operators

Membership Operators

Identity Operators

Bitwise Operators