1 00:00:07,650 --> 00:00:13,830 Now, the next thing I would like to look at are the if statements or how these statements are written 2 00:00:13,830 --> 00:00:14,440 in Python. 3 00:00:14,910 --> 00:00:17,860 So, as I said, this indentation language. 4 00:00:17,910 --> 00:00:22,130 OK, so here we care about the indentation levels in here. 5 00:00:22,140 --> 00:00:23,360 You will see how this works. 6 00:00:23,730 --> 00:00:27,810 So let's imagine that we're driving a car. 7 00:00:28,070 --> 00:00:36,310 OK, we're driving the car on the highway and our required speed is 100 miles per hour. 8 00:00:36,420 --> 00:00:40,770 So this is the maximum speed speed we can drive with above the speed. 9 00:00:40,770 --> 00:00:41,760 We're breaking the law. 10 00:00:41,940 --> 00:00:48,780 But also, if you drive with under 20 miles per hour, then this means that you are driving too slow 11 00:00:48,900 --> 00:00:51,580 and you are also not allowed to do this on the highway. 12 00:00:52,170 --> 00:00:58,040 So if you would like to create some code that is checking that how we do it, well, we do this with 13 00:00:58,050 --> 00:00:58,700 your statements. 14 00:00:59,130 --> 00:01:02,580 So the first thing I will do is I will simply create a car. 15 00:01:03,720 --> 00:01:06,800 Speed in here will add the value of our speed. 16 00:01:07,080 --> 00:01:11,850 Let's say that our speed is a lot, 100 kilometers per hour. 17 00:01:11,850 --> 00:01:12,110 Right. 18 00:01:12,600 --> 00:01:17,180 And now let's create the same logic here and we can use for these statements. 19 00:01:17,310 --> 00:01:18,360 So let's write if. 20 00:01:19,790 --> 00:01:29,960 Car speeds is higher than a hundred miles per hour, actually will make our speed here to be equal to 21 00:01:29,960 --> 00:01:30,540 70. 22 00:01:31,040 --> 00:01:36,080 So if the car's speed is higher than 200 miles per hour, then you're right. 23 00:01:36,540 --> 00:01:44,810 This symbol here and as you can see now, the line or the cursor is getting inside this if statement 24 00:01:45,260 --> 00:01:51,650 and this, because if we're right outside of right here, then this will not be added as a condition 25 00:01:51,650 --> 00:01:52,490 of this statement. 26 00:01:52,790 --> 00:01:58,830 OK, so here we say the car's speed is higher than 100. 27 00:01:59,090 --> 00:02:03,530 They would like to point to the driver you drive to. 28 00:02:04,680 --> 00:02:05,160 First. 29 00:02:06,970 --> 00:02:15,730 OK, and then since we're getting out of this if statement, we need to write on the same indentation 30 00:02:15,850 --> 00:02:23,900 level and here I will say, oh, if so, here I want another condition. 31 00:02:24,010 --> 00:02:28,930 So if something else happens, we'll write it by car. 32 00:02:30,340 --> 00:02:39,370 Speed is more than 20 miles per hour, then I would like to present to the driver that he is driving 33 00:02:39,550 --> 00:02:40,190 to slow. 34 00:02:40,420 --> 00:02:43,790 So I will say you drive too slow. 35 00:02:45,070 --> 00:02:56,050 This is a highway that's hit and in every other case or else anyone else for every other case. 36 00:02:56,470 --> 00:03:05,140 So this means when the speed is not higher than 100 and it's not more than 20, then we can print. 37 00:03:05,440 --> 00:03:08,060 Your speed is good. 38 00:03:08,950 --> 00:03:15,730 OK, and then here I will just print a radio so you can see on the screen that we are ready with the 39 00:03:15,730 --> 00:03:16,080 loop. 40 00:03:16,340 --> 00:03:21,670 OK, now let's run the code and see what is going to happen. 41 00:03:21,850 --> 00:03:30,550 So now, since our speed is 17, this means that our speed is good because it's between 20 and 100. 42 00:03:31,000 --> 00:03:38,020 However, if the speed is higher than one hundred and then let's see what is going to be printed here, 43 00:03:38,230 --> 00:03:39,550 you drive too fast. 44 00:03:39,740 --> 00:03:47,530 If I reduce the speed to 10 miles per hour, then if we run the court, obviously our speed will be 45 00:03:47,530 --> 00:03:49,360 to slow this highway. 46 00:03:50,080 --> 00:03:55,750 And this is how you basically use the more simple case of these statements in your court in order to 47 00:03:55,750 --> 00:03:57,570 decide between different conditions.