Arithmetic

  • Addition: a + b
  • Subtraction: a - b
  • Multiplication: a * b
  • Division: a / b
  • Modulus: a % b
  • Power: a ** b

Comparison

  • Equal: a == b
  • Not equal: a != b
  • Less than: a < b
  • Less than or equal: a <= b
  • Greater than: a > b
  • Greater than or equal: a >= b

Logical

  • And: a and b or a && b
  • Or: a or b or a || b
  • Not: not a or !a

Bitwise

  • Bitwise AND: a & b
  • Bitwise OR: a | b
  • Bitwise XOR: a ^ b
  • Bitwise NOT: ~a
  • Left shift: a << b
  • Right shift: a >> b

Assignment

  • Assign: a = b
  • Add and assign: a += b
  • Subtract and assign: a -= b
  • Multiply and assign: a *= b
  • Divide and assign: a /= b
  • Modulus and assign: a %= b
  • Power and assign: a **= b
  • Left shift and assign: a <<= b
  • Right shift and assign: a >>= b
  • Bitwise AND and assign: a &= b
  • Bitwise OR and assign: a |= b
  • Bitwise XOR and assign: a ^= b
Comments