1 00:00:03,040 --> 00:00:10,110 So now, since we finished most of the difficult operations or most of the different operations compared 2 00:00:10,120 --> 00:00:10,960 with the simple math. 3 00:00:11,350 --> 00:00:13,620 Let's move on to comparisons now. 4 00:00:13,630 --> 00:00:20,500 First of all, we need to think on what is the result of doing a comparison where usually the result 5 00:00:20,500 --> 00:00:21,630 is true or false. 6 00:00:21,640 --> 00:00:22,650 And I will prove this. 7 00:00:23,050 --> 00:00:26,020 So if X is equal to five. 8 00:00:26,950 --> 00:00:28,060 Higher than for. 9 00:00:29,110 --> 00:00:34,270 This statement is true because five is higher than for the less right to print. 10 00:00:35,490 --> 00:00:43,560 X. So now if I print X, I will get through because X here is assigned to a variable, X can be either 11 00:00:43,560 --> 00:00:50,690 true or false because five is either higher than four or it's not fair to them for their just options, 12 00:00:51,510 --> 00:00:57,830 then you can also do a different comparison by writing five, not equal to four. 13 00:00:58,650 --> 00:01:03,600 And this means not so five is five, not equal to four. 14 00:01:03,660 --> 00:01:04,470 Yes, it is. 15 00:01:04,890 --> 00:01:06,770 For that reason our answer is true. 16 00:01:07,350 --> 00:01:13,380 For example, if I do so, this is the comparison operator for equal. 17 00:01:13,530 --> 00:01:17,630 It is different than a single equal sign, as you can see. 18 00:01:17,640 --> 00:01:20,360 And yes, we can actually write the statement like that here. 19 00:01:20,700 --> 00:01:24,050 So here we're checking that if five is equal to four. 20 00:01:24,240 --> 00:01:27,180 So as you know, this is obviously not equal. 21 00:01:27,330 --> 00:01:34,740 And for that reason we're going to get false here because force is assigned to the variable effects. 22 00:01:34,980 --> 00:01:41,790 Now in Python, as in the other programming languages there, logical operations, OK? 23 00:01:42,060 --> 00:01:49,620 And as in C++ and in Java, usually the large corporations are performed by symbols. 24 00:01:49,860 --> 00:01:57,240 For example, this symbol is the symbol for and and usually or is denoted like this. 25 00:01:57,930 --> 00:01:59,610 But in Python, we don't have that. 26 00:01:59,700 --> 00:02:06,090 We don't recognize the symbols instead for simplicity and just our code to make sense. 27 00:02:06,090 --> 00:02:13,830 Plus we simply use the word or for our statement and we use the word and for any statement. 28 00:02:15,730 --> 00:02:23,320 And I will show you how this works, so let's write that, for example, our rent is equal to five hundred 29 00:02:23,320 --> 00:02:24,910 and fifty dollars. 30 00:02:25,480 --> 00:02:37,560 OK, then what would like to do is we want to print rent higher than 50 or rent more than 100. 31 00:02:38,080 --> 00:02:39,690 So let's think a little bit about it. 32 00:02:40,210 --> 00:02:42,930 Is our rent higher than 50 dollars? 33 00:02:42,940 --> 00:02:46,740 We said this is our rents, more than 100 hundred dollars. 34 00:02:47,020 --> 00:02:47,940 No, it is not. 35 00:02:48,640 --> 00:02:51,470 But since here we have the our statement. 36 00:02:51,700 --> 00:02:57,370 This means only one of the statements needs to be true for the whole line to be true, because this 37 00:02:57,370 --> 00:02:57,520 is. 38 00:02:57,520 --> 00:02:58,570 All right. 39 00:02:58,720 --> 00:03:01,990 So if I run the code now. 40 00:03:02,990 --> 00:03:07,950 You can see that the final result here is true because one of the statements here is true. 41 00:03:08,360 --> 00:03:10,340 OK, let's change this word to end. 42 00:03:12,060 --> 00:03:19,500 So when you're right and this means that both of the statements have to be true, right, so both the 43 00:03:19,500 --> 00:03:22,940 rent should be higher than 50 and bolder and more than 100. 44 00:03:23,430 --> 00:03:29,880 But since our rent is not in the range between 50 and 100, then the statement should be false. 45 00:03:30,060 --> 00:03:33,360 So let's run the code and you can see that our result here is false. 46 00:03:33,540 --> 00:03:39,360 For example, if I do that, I would like my rent to be more than one thousand. 47 00:03:39,450 --> 00:03:42,510 OK, since it is five hundred and fifty. 48 00:03:43,860 --> 00:03:51,300 Then we get the results because both of the statements in the and large corporation are equally true, 49 00:03:51,490 --> 00:03:53,090 then the whole line is true. 50 00:03:53,220 --> 00:03:56,930 You can add as many conditions as you want. 51 00:03:57,180 --> 00:04:02,600 So I can even after one more condition, rent should not be equal to 400. 52 00:04:02,760 --> 00:04:06,440 And this, again, will be true because our rent is not equal to 400. 53 00:04:07,290 --> 00:04:13,710 So you can see that now in the results we are getting because of our end statements are true and we 54 00:04:13,710 --> 00:04:19,950 can continue like this until we finish with our ideas for what those corporations to at.