PYTHON OPERATORS WITH PRACTICAL
PYTHON OPERATORS :
WATCH VIDEO FOR DETAIL EXPLANATION
- Arithmetic operators: Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication and division.
| Operator | Description | Syntax |
|---|---|---|
| + | Addition: adds two operands | x + y |
| - | Subtraction: subtracts two operands | x - y |
| * | Multiplication: multiplies two operands | x * y |
| / | Division (float): divides the first operand by the second | x / y |
| // | Division (floor): divides the first operand by the second | x // y |
| % | Modulus: returns the remainder when first operand is divided by the second | x % y |
| ** | Power : Returns first raised to power second | x ** y |
EXAMPLE:

Comments
Post a Comment