Arithmetic operators are used to perform basic mathematical operations.
In Python, the common arithmetic operators include addition, subtraction, multiplication, division, modulus, exponentiation, and floor division
Arithmetic operators are symbols used to perform mathematical calculations. The most common ones are:
Addition (+): Adds two numbers.
Subtraction (−): Subtracts one number from another.
Multiplication (× or *): Multiplies two numbers.
Division (÷ or /): Divides one number by another.
Modulus (%): Gives the remainder of a division operation.
+
)The addition operator is used to add two numbers together. It can also concatenate strings and combine lists.
-
)The subtraction operator subtracts the right operand from the left operand.
*
)The multiplication operator multiplies two numbers. It can also be used to repeat sequences like strings and lists.
/
)The division operator divides the left operand by the right operand and always returns a float, even if the division is exact.
//
)The floor division operator divides the left operand by the right operand and returns the largest integer less than or equal to the result.
%
)The modulus operator returns the remainder of the division of the left operand by the right operand.
**
)The exponentiation operator raises the left operand to the power of the right operand.