0d: 00h: 00m: 00s

🎁 Get 3 extra months of learning — completely FREE

That's 90 extra days to master new skills, build more projects, and land your dream job.

Become a PRO
Background Image

🎁 Get 3 extra months of learning completely FREE

Become a PRO
D
PRO
last month
Deborahcountry asked

What is a Boolean expression?

Palistha Singh
Expert
yesterday

Hi Deborah,

A Boolean expression is a statement that evaluates to either True or False.

For example:

x = 10

if x > 5:
    print("x is greater than 5")

Here, x > 5 is the Boolean expression. Since it’s true, the code inside the if block runs.

Boolean expressions are used in conditions to control the flow of a program — like in if, while, or logical checks.

If you have more questions, I am here to help.

Python
This question was asked as part of the Learn Python Basics course.