3 + +5, 3 + 5., -3 + True, 0X2a + -0xB, -0O70 + 0o30, -0B101 + 0b110, -2j + 5J

+3 - -5, 3. - 5, 2.5j - -1j

3e-4 * 5.0E0, -3 * False, -2.5j * 5J

13 / 5, -13. / 5, 13. / -5., -13. / -5., 13j / 5J

"""
Explanation: <h1 align="center">Operators</h1>

Arithmetic operators:

addition
subtraction
multiplication
division
floor division
modulus
exponentiation
End of explanation
"""


13 // 5, -13. // 5, 13. // -5., -13 // -5., 3.5 // 2

13 % 5, -13. % 5, 13. % -5., -13 % -5., 3.5 % 2

"""
Explanation: x // and x % y are such that:
- x = (x // y) * y + x % y;
- -|y|  <  x % y  <  |y|;
- the sign of x % y is equal to the sign of y.
End of explanation
"""


2 ** 3, -2. ** -1, 4 ** -0.5, (-1) ** 0.5, -3.8 ** 0, 1j ** 1j

"""
Explanation: $i^i = e^{-\pi/2}$
End of explanation
"""


~34, ~3, ~2, ~1, ~0, ~-1, ~-2, ~-3, ~-34

9 & 10, -9 & 10, 9 & -10, -9 & -10

9 | 10, -9 | 10, 9 | -10, -9 | -10

9 ^ 10, -9 ^ 10, 9 ^ -10, -9 ^ -10

5 >> 2, -5 >> 2

5 << 2, -5 << 2

"""
Explanation: Bitwise operators:

ones complement
AND
OR (inclusive or)
XOR (exclusive or)
right shift
left shift 

...
-4&nbsp;:&nbsp;...1...100
-3&nbsp;:&nbsp;...1...101
-2&nbsp;:&nbsp;...1...110
-1&nbsp;:&nbsp;...1...111
&nbsp;0&nbsp;:&nbsp;...0...000
&nbsp;1&nbsp;:&nbsp;...0...001
&nbsp;2&nbsp;:&nbsp;...0...010
&nbsp;3&nbsp;:&nbsp;...0...011
&nbsp;4&nbsp;:&nbsp;...0...100
...
End of explanation
"""


1 == 1., 0 != False

1 <= 1 < 2 >= 2 > 1

"""
Explanation: Relational operators:
End of explanation
"""


not 3.3, not []

True and (1, 2, 3), () and 1 / 0

{} or {0}, {'A': 1, 'B': 2} or 1 / 0

"""
Explanation: Boolean operators
End of explanation
"""


2 is 2, [] is [], 2 is not 2., True is not 1

"""
Explanation: Identity operators
End of explanation
"""


'B' in {'A': 1, 'B': 2, 'C': 3}, 0 not in [[0]]

"""
Explanation: Membership operators
End of explanation
"""


x = 1
x <<= 2
print(x)
x >>= 1
print(x)
x += 1
print(x)
x -= 2
print(x)
x *= 3
print(x)
x /= 2
print(x)
x %= 2
print(x)
x //= -2
print(x)

"""
Explanation: Assignment operators
End of explanation
"""


20 / 10 / 2, 20 // (10 // 2)

7 % 5 % 3, 7 % (5 % 3)

2 ** 3 ** 2, (2 ** 3) ** 2

1 << 2 << 1, 1 << (2 << 1)

8 >> 2 >> 1, 8 >> (2 >> 1)

"""
Explanation: Precedence and associativity
From highest to lowest precedence:

**
~ &emsp; unary + &emsp; unary -
* &emsp; / &emsp; // &emsp; %
binary + &emsp; binary -
>> &emsp; <<
&
^
|
<= &emsp; < &emsp; > &emsp; >= &emsp; == &emsp; != &emsp; is &emsp; is not &emsp; in  &emsp; not in
= &emsp; (and all augmented assignments)
not
and
or
End of explanation
"""


