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

Card Puncher Data Processing

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)
== is used to compare whether two things are equal, and = is used to assign a value to a variable.

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

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

Flow Statement





Discover More
Card Puncher Data Processing
Python - If Statement

in Python See also: The block of code in Python is indented with 4 spaces. See Syntax: Example: Nested if/else:



Share this page:
Follow us:
Task Runner