Knowledge Card - Common Operators
Common Operators
-
Arithmetic Operators:
+
,-
,*
,/
,%
- Example:
x = 10 % 3
results in1
.
- Example:
-
Comparison Operators:
==
,!=
,<
,>
,<=
,>=
- Example:
x > y
evaluates toTrue
orFalse
.
- Example:
-
Logical Operators:
and
,or
,not
- Example:
x > 5 and x < 10
checks ifx
is between5
and10
.
- Example:
-
Assignment Operators:
=
,+=
,-=
,*=
,/=
- Example:
x += 5
is equivalent tox = x + 5
.
- Example: