Python supports several operators. Here, we review some of the key ones.
We use the arithmetic operators to do simple math on two variables or literals. Be sure to only try to use arithmetic operators on like types. For example, if you try to add a string value to a integer (3 + “ is a number”) you will get an error.
Adds the left value to the right:
>>> lvariable = 5>>> sum = lvariable + 3>>> sum8
Subtracts the right value from left:
>>> lvariable = 5>>> difference = lvariable - 3>>> difference2
Multiplies left value by right:
>>> lvariable = 5>>> product ...