Python - Control flow (Comparator, Boolean Operator and Conditional Statement)

Card Puncher Data Processing

Python - Control flow (Comparator, Boolean Operator and Conditional Statement)

About

Language - Control Flow Statement (If, Switch, For) - Conditional Operators - Execution order - Branch Conditionals (aka decisions) in Python

Operator

Comparators

  • Equal to (==)
  • Not equal to (!=)
  • Less than (<)
  • Less than or equal to (<=)
  • Greater than (>)
  • Greater than or equal to (>=)
  • In (for a string or a list)
<wrap>== is used to compare whether two things are equal, and = is used to assign a value to a variable.</note>

Comparisons generate (one of two)?? results: True or False

variable_true  = 1 <= 2
variable_false = 1 == 2

Flow Statement







Share this page:
Follow us:
Task Runner