8. Boolean Variables

8.1. Relational Operators

System Message: ERROR/3 (/home/runner/work/PyZombis/PyZombis/_sources/lectures/TWP05/TWP05_8_en.rst, line 12)

Error parsing content block for the “table” directive: exactly one table expected.

.. table:: **Relational Operators**
   :widths: auto

   ======== ============== ==============================
   Operator Operation      Mathematical equivalent symbol
   ======== ============== ==============================
   ==       equal          =
   >        greater than   >
   <        less than      <
   !=       not equal      <>
   >=       greater or equal  >=
   <=       less or equal  <=
   ======== ============== ==============================
  • Note that the equality operator is two equals (==)

8.2. Examples:

Activity: CodeLens 8.2.1 (cl_l05_8a_en)

8.3. Important Example

  • >= or <= for equal values

Activity: CodeLens 8.3.1 (cl_l05_8b_en)

8.4. Example

  • We can use relational operators to initialize logical variables

Activity: CodeLens 8.4.1 (cl_l05_8c_en)

You have attempted of activities on this page