Welcome back.
So now we're going to discuss what are called boolean expressions.
And we can go ahead and just type this right into our text file if you don't have your file open with
GZA.
Go ahead and get your script up high open and we're gonna do is we're going to just put in here boolean
expressions.
And now when we say boolean expressions we can just think of this as true or false.
So let's go ahead and print our new subject line or to in a call these boolean expressions.
And from here let's start defining those so let's say we have boolean expression one we'll just call
the variable bool one.
Now let's just set that equal to true.
OK.
And let's give an example of that as well.
Let's just say boolean to equals let's say three times three now.
What does three times three equals.
Well that equals nine.
So we can say equals equals to mean something equals something.
And so this number equals this number.
So three times three is nine which equals nine.
So if we take this expression and we say nine equals nine it's going to return true.
Let's do a couple more.
So we could say a billion three equals false and billion four equals three times three.
And then we can say does not equal nine.
Well that's not true.
Right.
So that's false.
So if we were to print these all out we could say print billion one billion to both three and bull for.
OK.
And let's also print the type.
So we know about this.
So there's a print type.
And let's take a look at what this looks like so once you have that all written out go ahead and just
save this and go ahead and run your file and you can see that it came out exactly how we thought it
would.
So we've got four variables and they're all boolean expressions right.
So we've got true this equals to true.
This is false.
And this is equal to False.
So we see a true true false false.
We print those all out and then when we want to look at the type of the variable so we say hey what's
stored in here inside this variable what's stored is a boolean.
Now please do note that there is a difference between true and true.
One is a string and one is a boolean.
So if you were to set boolean Phi for example to true and then you printed the type of boolean five
then you're going to get a different result here.
You're going to see now that the type is a class of string.
So big difference here I'm going to go ahead and just delete this.
So this is just an overview of boolean expressions.
We're going to use this later on and you will see it again when we get into X flight development.
But you're going to see certain things especially when you get into loops as well.
So once we start getting into looping and we talk about that it will make a little bit more sense.
But you want to know sometimes if something is true or something is false or when we get into conditional
statements if something is true then do this or if something is false do this.
We haven't gotten quite that far yet but we need to introduce the concepts before we can build upon
it.
So we're gonna do in the next video is we're going to build upon these even more.
We're going to take relational operators and these boolean expressions and kind of combine them and
start building upon it.
And then once we get this all put together it'll all start making sense.
So for now all you need to know is when I say bullying expression all I'm thinking about is true or
false.
So we'll build upon that in later videos.