🐍 Operators

num math operators

Comparison Operators

a == b     # equal
a != b     # not equal
a > b      # greater than
a >= b     # greater or equal
a < b      # less than
a <= b     # less or equal

Arithmetic Operators

a + b      # addition
a - b      # subtraction
a * b      # multiplication
a / b      # division
a // b     # floor division (no decimals)
a % b      # modulo (rest)
a ** 3     # exponent (power)

Assignment Operators

a += 2     # a = a + 2
a -= 2     # a = a - 2
a *= 2     # a = a * 2
a /= 5     # a = a / 5

Logical Operators

x or y     # OR
x and y    # AND
not x      # NOT (negation)