Operators
This lesson will focus on different types of operators in Python.
We'll cover the following...
Operators
Operators are used to perform arithmetic and logical operations on data. They use the provided data and give results. Some operators follow the in-fix (a + b) notation while some follow the pre-fix (- a) notation. With in-fix notation, the operands are placed on the left and right side of the operator. With pre-fix notation, the operator is placed before the operand. We will look at the different kinds of operators in Python in this lesson.
Arithmetic operators
Arithmetic operators are used to perform arithmetic operations such as addition, multiplication, division, etc. They can be used in conjunction with each other, hence they have an order of precedence as well. Some of the most common operators are listed below in order of precedence.
()
: Parenthesis. Whatever is in the parenthesis will be evaluated first.**
: Exponent (In-fix)%
,*
,/
,//
: Modulo, Multiplication, Division, Floored Division (In-fix