1 00:00:00,210 --> 00:00:04,770 OK, now it's time for the conditional or else elf statements. 2 00:00:04,980 --> 00:00:07,080 OK, now it is as simple as that. 3 00:00:07,080 --> 00:00:08,430 The syntax is like this. 4 00:00:08,430 --> 00:00:11,910 You put the F and then you put either brackets or without brackets. 5 00:00:11,930 --> 00:00:14,350 But I prefer with perfect brackets, actually. 6 00:00:14,700 --> 00:00:17,280 And then you put the condition and the condition. 7 00:00:17,280 --> 00:00:19,620 If it is true, then it will print. 8 00:00:20,550 --> 00:00:29,100 So yeah, let's put an explicit value, which is the all this will be on that F body, which is this 9 00:00:29,100 --> 00:00:29,370 one. 10 00:00:29,520 --> 00:00:30,330 So let's print. 11 00:00:33,520 --> 00:00:40,960 Yes, it is true, and you can use something else, so if it is, it's yeah, let's bring it this time 12 00:00:41,740 --> 00:00:42,370 it's print. 13 00:00:45,530 --> 00:00:48,520 No, it is false. 14 00:00:48,680 --> 00:00:51,590 OK, so by the way, this will Brent yes. 15 00:00:51,590 --> 00:00:54,670 By the way, because the because the condition here is, too. 16 00:00:55,070 --> 00:00:56,210 So let's have a look here. 17 00:00:56,810 --> 00:01:03,560 It's clear the screen and you can see, yes, it is true, which means that it worked correctly because 18 00:01:03,560 --> 00:01:05,070 we the condition is true. 19 00:01:05,420 --> 00:01:05,830 All right. 20 00:01:05,870 --> 00:01:15,290 Now it's time to have some variable some things actually worked or used in real world, not just simple 21 00:01:15,530 --> 00:01:16,150 statement. 22 00:01:16,400 --> 00:01:19,310 So let's put far one equal. 23 00:01:20,550 --> 00:01:32,100 Ten and here inside it, I would bet that if we one less than or greater than or equal equal, then 24 00:01:32,100 --> 00:01:34,860 use this equally equal or not equal. 25 00:01:35,290 --> 00:01:39,810 OK, you can use this, but for now it's use less than 20. 26 00:01:41,760 --> 00:01:48,990 Only less than five, so it is in this that five not force it will bring not with this force. 27 00:01:49,230 --> 00:01:50,220 So let's check this out. 28 00:01:51,240 --> 00:01:52,050 No, it is. 29 00:01:52,500 --> 00:02:02,190 OK, now, actually, we can put a boolean variables here so far to this put this time Fourth's, OK, 30 00:02:02,550 --> 00:02:04,550 or let's put it as a tool. 31 00:02:04,860 --> 00:02:13,710 So to ensure a different set and value or different output, and here you can just put the name of the 32 00:02:13,710 --> 00:02:14,230 variable. 33 00:02:14,910 --> 00:02:15,810 This is the first one. 34 00:02:16,140 --> 00:02:23,730 So the name of the variable, you will do the job because if the bato true, if it is too far to his 35 00:02:23,730 --> 00:02:29,780 torso, which means that the output of the condition here is true, which means it will print here, 36 00:02:29,850 --> 00:02:33,480 or you can put or use the equation equal operator. 37 00:02:33,840 --> 00:02:38,010 So equal, equal and it is equal equal to Attrill. 38 00:02:38,460 --> 00:02:42,750 So this time it will print here because it is actually it is true. 39 00:02:43,140 --> 00:02:44,570 So it will print. 40 00:02:44,580 --> 00:02:45,060 Yes. 41 00:02:45,360 --> 00:02:45,840 If there's. 42 00:02:46,740 --> 00:02:51,420 But by the way, if you put the Barthel which is the true equal. 43 00:02:51,420 --> 00:02:53,100 Equal to false. 44 00:02:54,560 --> 00:02:58,520 Now, it's far too early to know, so this time. 45 00:02:59,430 --> 00:03:01,050 It will bring no, it is false. 46 00:03:01,330 --> 00:03:01,650 OK. 47 00:03:02,970 --> 00:03:09,870 Now it's up to you how you write your programs, why you to use the condition when to use it. 48 00:03:10,890 --> 00:03:18,360 What condition you can actually put subtraction addition divided by two modules actually depends on 49 00:03:18,570 --> 00:03:19,850 what your your case. 50 00:03:20,250 --> 00:03:26,880 Now, this is the first syntax, which is if it's OK now, actually, what if I want to put inside the 51 00:03:26,880 --> 00:03:30,150 answer, which is something called the nested officials here. 52 00:03:30,840 --> 00:03:33,920 Now, actually, there is something called indentation. 53 00:03:34,440 --> 00:03:35,430 You can see that here. 54 00:03:35,640 --> 00:03:44,100 The if you start from here, as you can see, and we put the colon here and here is an indentation, 55 00:03:44,310 --> 00:03:51,480 which means, as you can see for spaces, which means that this print statement is inside the body and 56 00:03:51,480 --> 00:03:57,590 the else, the same thing, one, two, three, four, four spaces. 57 00:03:57,600 --> 00:04:00,770 And here I can bootprint or whatever I want here. 58 00:04:01,230 --> 00:04:05,410 This means that this brain function or this statement is inside the body. 59 00:04:05,470 --> 00:04:13,880 OK, but because actually, if I what if I put it like this so it isn't anything nor anything if I removed 60 00:04:13,950 --> 00:04:20,500 the indentation and this is what inside the python like this, this would give us an error. 61 00:04:21,120 --> 00:04:22,020 So if I type here. 62 00:04:22,200 --> 00:04:27,900 Yeah, you can see expected and intended block, which means that you forget something. 63 00:04:28,410 --> 00:04:31,320 So you can but this actually the bi type two spaces. 64 00:04:31,470 --> 00:04:32,190 So let's see. 65 00:04:32,670 --> 00:04:33,110 Yeah. 66 00:04:33,120 --> 00:04:35,970 Jeanine's what you can see that if I type two spaces it would work. 67 00:04:35,970 --> 00:04:41,850 But actually it's better to use for spaces because it will be more elegant and moderne way to write 68 00:04:41,850 --> 00:04:42,270 your code. 69 00:04:42,480 --> 00:04:43,760 Now one last thing. 70 00:04:44,040 --> 00:04:49,920 So inside the elsea I can put another if this is what I want to talk about. 71 00:04:50,730 --> 00:04:59,000 So if I type if an address and whatever I want, then inside it wherever and for that else. 72 00:04:59,520 --> 00:05:07,620 So you can see statement here and inside you can see what else as well and but whatever you want and 73 00:05:07,620 --> 00:05:10,050 then you can print whatever you want. 74 00:05:10,080 --> 00:05:17,220 OK, so actually so here another example here you can see this is outside of the LS but if I put it 75 00:05:17,220 --> 00:05:24,720 here like this, like this now that actually this is inside the else and this is inside this if and 76 00:05:24,720 --> 00:05:32,160 this is outside the elsea, OK, I think it is a symbol because if you are using your studio you can 77 00:05:32,160 --> 00:05:33,600 see that it is highlighted. 78 00:05:33,600 --> 00:05:38,100 We have lined this here, which means all of that is the name of that. 79 00:05:38,100 --> 00:05:41,310 You can see that all of that is what else. 80 00:05:41,610 --> 00:05:43,980 And here all of that is for if and so on. 81 00:05:44,220 --> 00:05:44,620 OK. 82 00:05:45,120 --> 00:05:49,610 Now, the last thing I want to say about or talk about, which is the ELIF. 83 00:05:50,010 --> 00:05:58,770 OK, now this is another thing, which is a combination of Elz and if so in if ok so elif what the condition 84 00:05:58,770 --> 00:06:06,090 you want and the same thing with indentation and so ok, but don't forget to put indentation here like 85 00:06:06,090 --> 00:06:08,840 this, which means that this is inside the left. 86 00:06:09,270 --> 00:06:09,580 OK. 87 00:06:09,930 --> 00:06:12,690 And of course you need to remove the entire. 88 00:06:13,640 --> 00:06:14,330 Nyqvist. 89 00:06:15,510 --> 00:06:15,980 So, yeah. 90 00:06:17,060 --> 00:06:21,650 Everything is expected, so you know what the first condition. 91 00:06:22,200 --> 00:06:28,070 OK, then you use the second condition, then you use a third condition or fourth condition. 92 00:06:28,120 --> 00:06:28,490 OK. 93 00:06:28,520 --> 00:06:34,420 OK, so you need to to have more filtering so you can use that instead if it's all right. 94 00:06:34,650 --> 00:06:39,670 Now, actually, this is just a simple overview or brief about if and the condition and operators. 95 00:06:40,010 --> 00:06:41,510 OK, now don't worry about that. 96 00:06:41,520 --> 00:06:47,950 We would use that in practice when times come to when we started writing our own tools. 97 00:06:48,960 --> 00:06:53,940 Actually, in a very practical way, so for now, just keep in your mind, what is the syntax, how 98 00:06:53,940 --> 00:06:56,990 to write, what are the statements, how they work? 99 00:06:57,630 --> 00:07:02,370 And we learn that we have if we have is we have it is we have it. 100 00:07:02,370 --> 00:07:06,500 If L.F. then instead if I mean and else whatever. 101 00:07:06,510 --> 00:07:09,690 OK, so and we learned that we have internation. 102 00:07:09,870 --> 00:07:15,780 So this is to distinguish between which statement for which instructor or which instruction. 103 00:07:16,000 --> 00:07:22,830 So this is for that and this is for the F or F or if this is for the ILS and so on. 104 00:07:22,920 --> 00:07:23,290 OK. 105 00:07:23,850 --> 00:07:24,200 OK. 106 00:07:24,240 --> 00:07:24,930 Thanks for watching.