Equality

Computer programs need to make many decisions. “Should I download that file?” “Should I send that email?” “Should I fire the nukes?” We generally call these conditionals, we do something on condition that something is true.

We’ll cover conditionals themselves later. Today, we’re going to focus on the “something is true” part. Booleans (or bools) are values which are either true or false. We use them a lot in computer programming.

For now, we’re going to dive into this type, its operations, and the logic around it. This will prepare us to make more intelligent programs later, which will build conditionals on top of Booleans.

So, let me ask you a question: does 2 + 3 equal 5? Hopefully, you can figure that out. But here’s another question: can you ask your computer to figure it out for you? It turns out you can!

Get hands-on with 1000+ tech skills courses.