Hour of Code: Code with Mary

Part 3: This or That

Boolean Variables and Conditionals

Boolean Variables

A boolean variable is a special type of variable that contains one of two possible values: true or false.

By themselves, boolean variables don't seem to do too much, but they are a powerful tool when working with control structures, as we will soon see.

Try it!

Make a boolean variable and assign it a value of true: boolean sayStatement = false.

Create a text variable named "greeting" and assign it a string you like in double quotes: text greeting = "Hello!"

We will use these variables in a couple slides.

Try it Yourself

Next Tutorial

In the next tutorial, we will discuss Hour of Code Part 4, which describes first steps in Quorum.