Section 1 - Instruction

Beyond numbers and text, programs often need to represent simple "yes" or "no" states, like whether a light switch is on or off.

Python has a specific data type for this kind of information.

Engagement Message

Can you think of a situation where you only need a true/false answer?

Section 2 - Instruction

This data type is called a Boolean, named after George Boole. In Python code, it's shortened to bool.

A Boolean variable can only hold one of two possible values: True or False.

Engagement Message

Why do you think these specific words are used?

Section 3 - Instruction

It's crucial to remember that True and False must start with a capital letter in Python. true or false (lowercase) won't work.

Engagement Message

How is this different from storing the word "True" as a string?

Section 4 - Instruction

Booleans are fundamental for decision-making in code. We often get Boolean values by comparing other values.

For example, we can check if two numbers are equal using == (double equals sign).

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal