- In the self check exercise that you see here,
we'd like you to use the values
for the variables i, j, k and m.
That you see,
to evaluate the conditions that we've listed out for you.
And you may want to go ahead and
try those with the parentheses as specified
and without to see if you get the same
or different values in each case.
So go ahead and pause the video and give that a shot.
And then come back to see the results.
Okay, let's go ahead
and execute these four assignments statements.
Now you can actually click to the left of a given cell
and then shift and click to left of a later cell
to highlight multiple cells.
And if you want to execute them all at once you can then
type control enter and it will execute all four,
in this case of those cells.
So we've just defined the variables
and down below here we've already inserted in our notebook
each of the expressions that you saw
in the problem statement up above.
So, let's keep these here so we can see them.
So currently, we have i greater than equal to one.
That's going to be true,
j less than four is also going to be true.
So, both of these are true
and therefore the entire expression is true.
With m, we have the value two
and with k we have the value three.
So, two is less than or equal to 99
and three is not less than two.
Therefore this should be false
and similarly j and i, k and m here.
So, j is two, i is one.
So j is greater than or equal i is true.
k is not equal to m, so again,
we get in this case true.
Because it's an or operator, so if either the left is true
or the right is true, the whole thing will be true.
Down bellow we're doing some arithmetic as well,
so we have k plus m, so that's five.
Checking whether that's less than j,
which it is not.
So the reason for the parentheses here,
is to make sure the whole expression
gets evaluated properly and also for clarity as well.
Over here three minus j, so three minus j which is two.
So that gives us, one and we're checking to see
if that greater than or equal to three.
Which it is not,
so you can see the whole expression is false
because both sides are false.
And k greater than m, so k is three, m is two.
This is true, but not is being applied to it.
So we get false, as a result.