1 00:00:01,620 --> 00:00:03,770 - In the self check exercise that you see here, 2 00:00:03,770 --> 00:00:05,790 we'd like you to use the values 3 00:00:05,790 --> 00:00:08,330 for the variables i, j, k and m. 4 00:00:08,330 --> 00:00:09,410 That you see, 5 00:00:09,410 --> 00:00:13,750 to evaluate the conditions that we've listed out for you. 6 00:00:13,750 --> 00:00:15,130 And you may want to go ahead and 7 00:00:15,130 --> 00:00:18,370 try those with the parentheses as specified 8 00:00:18,370 --> 00:00:20,650 and without to see if you get the same 9 00:00:20,650 --> 00:00:23,490 or different values in each case. 10 00:00:23,490 --> 00:00:26,130 So go ahead and pause the video and give that a shot. 11 00:00:26,130 --> 00:00:28,063 And then come back to see the results. 12 00:00:32,830 --> 00:00:34,100 Okay, let's go ahead 13 00:00:34,100 --> 00:00:38,810 and execute these four assignments statements. 14 00:00:38,810 --> 00:00:42,710 Now you can actually click to the left of a given cell 15 00:00:42,710 --> 00:00:46,490 and then shift and click to left of a later cell 16 00:00:46,490 --> 00:00:48,500 to highlight multiple cells. 17 00:00:48,500 --> 00:00:52,490 And if you want to execute them all at once you can then 18 00:00:52,490 --> 00:00:55,960 type control enter and it will execute all four, 19 00:00:55,960 --> 00:00:57,440 in this case of those cells. 20 00:00:57,440 --> 00:00:59,630 So we've just defined the variables 21 00:00:59,630 --> 00:01:03,610 and down below here we've already inserted in our notebook 22 00:01:03,610 --> 00:01:05,330 each of the expressions that you saw 23 00:01:05,330 --> 00:01:07,570 in the problem statement up above. 24 00:01:07,570 --> 00:01:10,710 So, let's keep these here so we can see them. 25 00:01:10,710 --> 00:01:13,560 So currently, we have i greater than equal to one. 26 00:01:13,560 --> 00:01:14,920 That's going to be true, 27 00:01:14,920 --> 00:01:17,410 j less than four is also going to be true. 28 00:01:17,410 --> 00:01:19,050 So, both of these are true 29 00:01:19,050 --> 00:01:22,110 and therefore the entire expression is true. 30 00:01:22,110 --> 00:01:24,090 With m, we have the value two 31 00:01:24,090 --> 00:01:25,940 and with k we have the value three. 32 00:01:25,940 --> 00:01:29,410 So, two is less than or equal to 99 33 00:01:29,410 --> 00:01:32,110 and three is not less than two. 34 00:01:32,110 --> 00:01:34,180 Therefore this should be false 35 00:01:35,390 --> 00:01:38,680 and similarly j and i, k and m here. 36 00:01:38,680 --> 00:01:41,120 So, j is two, i is one. 37 00:01:41,120 --> 00:01:44,330 So j is greater than or equal i is true. 38 00:01:44,330 --> 00:01:46,853 k is not equal to m, so again, 39 00:01:47,790 --> 00:01:49,300 we get in this case true. 40 00:01:49,300 --> 00:01:52,300 Because it's an or operator, so if either the left is true 41 00:01:52,300 --> 00:01:55,900 or the right is true, the whole thing will be true. 42 00:01:55,900 --> 00:01:58,390 Down bellow we're doing some arithmetic as well, 43 00:01:58,390 --> 00:02:01,990 so we have k plus m, so that's five. 44 00:02:01,990 --> 00:02:03,930 Checking whether that's less than j, 45 00:02:03,930 --> 00:02:05,020 which it is not. 46 00:02:05,020 --> 00:02:07,550 So the reason for the parentheses here, 47 00:02:07,550 --> 00:02:09,230 is to make sure the whole expression 48 00:02:09,230 --> 00:02:13,550 gets evaluated properly and also for clarity as well. 49 00:02:13,550 --> 00:02:18,550 Over here three minus j, so three minus j which is two. 50 00:02:18,670 --> 00:02:21,560 So that gives us, one and we're checking to see 51 00:02:21,560 --> 00:02:23,110 if that greater than or equal to three. 52 00:02:23,110 --> 00:02:24,220 Which it is not, 53 00:02:24,220 --> 00:02:26,200 so you can see the whole expression is false 54 00:02:26,200 --> 00:02:28,560 because both sides are false. 55 00:02:28,560 --> 00:02:31,900 And k greater than m, so k is three, m is two. 56 00:02:31,900 --> 00:02:34,940 This is true, but not is being applied to it. 57 00:02:34,940 --> 00:02:36,923 So we get false, as a result.