Knowledge Card - Common Operators

Common Operators

  1. Arithmetic Operators: +, -, *, /, %

    • Example: x = 10 % 3 results in 1.
  2. Comparison Operators: ==, !=, <, >, <=, >=

    • Example: x > y evaluates to True or False.
  3. Logical Operators: and, or, not

    • Example: x > 5 and x < 10 checks if x is between 5 and 10.
  4. Assignment Operators: =, +=, -=, *=, /=

    • Example: x += 5 is equivalent to x = x + 5.