Vocabulary

  • Boolean: A denoting system of algebraic notation for represent logical propositions.

  • Relational Operators: The mathematical relationship between two variables.

  • Logical Operators: For example, and, or, not.

  • Selection: The specific block of code that will execute.

  • Algorithm: A finite set of instructions that accomplish a task.

  • Conditional Statement: One of the conditional statement is if statement, it affect the sequence of control.
And are used to display the opposite.
Not are used to evaluate two condition at the same time.
Or are used to check if one of two condition is met.

Logical Operators example

sequence: Not, And, Or

bootSuccess = True
result = not(bootSuccess)
print(result)
False
num1 = 100
if num1 >= 100 and num1 < 200:
    print("The number satisfy")
The number satisfy
candy = 80
chocolate = 60
if candy < 60 or chocolate > 50:
    print("enough treats")
enough treats

Nested Conditional

  • It consist of conditional statements within conditional statements.
  • They are nested or included one inside another. For example, a if in a if statement is a nested conditional statement.