What is a Boolean?

Now let's talk about another new type that you'll see a lot in Python. This type has kind of a strange name - it's called a Boolean.

A boolean only has two possible values - it can be either True or False.

Booleans are a pretty simple idea, but they're very important - we use them in programming a lot when we need to make decisions about what to do in our code:

"If this expression is True, do something; if the expression is False, do something else instead."

Let's try typing a few examples. Notice that we're also using some of our comparison operators here - 'equal to' and 'less than'.

Is 1 equal to 1? Let's ask Python:

>>> 1 == 1

True

Is 15 less than 5?

>>> 15 < 5

False