python // operator meaning code example
Example 1: operators in python
Operator Name Example
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
% Modulus x % y
** Exponentiation x ** y
// Floor division x // y
Example 2: |= operator python
>>> s1 = {"a", "b", "c"}
>>> s2 = {"d", "e", "f"}
>>>
>>> s1 | s2
{'a', 'b', 'c', 'd', 'e', 'f'}
>>> s1
{'a', 'b', 'c'}
>>>
>>> s1 |= s2
>>> s1
{'a', 'b', 'c', 'd', 'e', 'f'}
Example 3: x and y in python
x + y = 19
x - y = 11
x * y = 60
x / y = 3.75
x // y = 3
x ** y = 50625