Skip to main content

What are booleans?

Booleans are the simplest data type - they can only be True or False. Think of them as yes/no answers.
Boolean values are True and False with capital letters. Using true or false will cause an error!

Creating booleans

Booleans often come from comparisons:

Comparison operators

These operators compare values and return True or False:
Remember: = assigns a value, while == compares values. This is a common source of bugs!

Common mistakes

What’s next?

Now that you understand data types, let’s learn how to work with them using operators!

Operators

Math, comparisons, and more