Symbols for Performing Operations, Operators
In programming, an Operator
refers to a symbol or keyword used to perform a specific operation.
Key Python Operators
Operators are symbols that perform mathematical or logical operations. In Python, the following operators are mainly used:
Arithmetic Operators
Operators like +
(addition), -
(subtraction), *
(multiplication), /
(division), **
(exponentiation), %
(modulus), //
(floor division) are used to perform arithmetic operations between numbers.
Example of Using Arithmetic Operators
multiply = 10 * 5 # 50
division = 10 / 2 # 5.0, Division in Python returns a float
integer_division = 10 // 3 # 3, Returns the integer part of the division result
remainder = 10 % 3 # 1
power = 2 ** 3 # 8