Back to Course

Introduction to Python

0% Complete
0/0 Steps
  1. Python: Basics
    14Topics
    |
    15 Quizzes
  2. Python: Control Flow
    12Topics
    |
    12 Quizzes
  3. Python: Errors
    5Topics
    |
    5 Quizzes
Lesson 2, Topic 1
In Progress

Python: Boolean Expressions

Yasin Cakal 5 Oct 2021
Lesson Progress
0% Complete

To incorporate control flow into our program, we need to determine whether something is true or false. A boolean expression is a statement that has only two possible outcomes: True or False.

It is going to rain today!

This statement is a boolean expression because it can either be True or False. There are no other alternatives. It might snow, hail, or be sunny all day! As long as it did not rain, the statement is False! But, if a drop of rain touches the ground, the statement is True!

Blue is the best color ever!

This is NOT a boolean expression because it is an opinion. It might be true according to me, but false according to you.

The alphabet starts with the letter C!

This is obviously false, but it is a boolean expression. Remember that a boolean expression can only be true or false!

%d bloggers like this: