1 00:00:12,550 --> 00:00:17,150 Hi, guys, and welcome in this lecture, we will discuss comparison operators on boolean variables. 2 00:00:17,740 --> 00:00:18,070 All right. 3 00:00:18,070 --> 00:00:26,140 So basically saying in Python we can take two values or two variables is the same and then ask a question 4 00:00:26,140 --> 00:00:26,710 about them. 5 00:00:27,250 --> 00:00:28,180 Are they equal? 6 00:00:29,180 --> 00:00:30,340 Are they not equal? 7 00:00:31,250 --> 00:00:36,200 Is one bigger than the other or one may be smaller than the other? 8 00:00:36,680 --> 00:00:37,070 All right. 9 00:00:37,470 --> 00:00:41,350 And this this is what comparison operators are in a few words. 10 00:00:41,390 --> 00:00:41,690 All right. 11 00:00:41,690 --> 00:00:46,430 So call person operators is a logical action taken upon two values. 12 00:00:47,030 --> 00:00:50,810 When we want to compare to values in Python, we use these operators. 13 00:00:51,110 --> 00:00:54,810 Then we will get a true or false value. 14 00:00:55,730 --> 00:01:00,410 So let me ask you guys that question. 15 00:01:00,830 --> 00:01:03,860 Does six equals seven? 16 00:01:04,370 --> 00:01:05,510 Does this mean to. 17 00:01:08,380 --> 00:01:08,920 All right. 18 00:01:12,610 --> 00:01:18,310 I meant this one, there's this thing through or this is, I mean, false. 19 00:01:18,490 --> 00:01:24,100 All right, so this one is a false idol because six doesn't equal seven. 20 00:01:24,700 --> 00:01:35,410 So just like like I said, in operators, you just ask question upon two variables, or we can ask ourselves, 21 00:01:35,410 --> 00:01:38,710 does six equals six? 22 00:01:38,920 --> 00:01:41,860 So the result of that question is true. 23 00:01:41,990 --> 00:01:42,390 Right. 24 00:01:43,810 --> 00:01:45,250 So basically, that's it. 25 00:01:45,650 --> 00:01:47,410 It's not very complicated. 26 00:01:48,190 --> 00:01:50,650 And this is the logic behind it. 27 00:01:50,980 --> 00:01:53,110 And this is how we put it. 28 00:01:53,710 --> 00:01:58,390 This is the operator sine and this is how we can use it actually in the code. 29 00:01:58,420 --> 00:01:58,770 All right. 30 00:01:59,170 --> 00:02:03,280 So this sound means not equals meaning. 31 00:02:03,610 --> 00:02:06,520 For example, three doesn't equal four or five. 32 00:02:07,390 --> 00:02:09,190 This means bigger meaning. 33 00:02:09,190 --> 00:02:11,970 X is bigger than Y, for example. 34 00:02:11,980 --> 00:02:14,910 Seven is actually bigger than five. 35 00:02:15,040 --> 00:02:16,960 So that's a true statement. 36 00:02:17,900 --> 00:02:18,920 And the opposite way. 37 00:02:20,060 --> 00:02:27,230 All right, so the next topic is boolean variables, all right, so these two are connected because 38 00:02:27,230 --> 00:02:28,100 this is the Boolean. 39 00:02:28,140 --> 00:02:29,720 This is the comparison operator. 40 00:02:30,030 --> 00:02:30,260 All right. 41 00:02:30,330 --> 00:02:31,420 This is the operator. 42 00:02:31,730 --> 00:02:34,160 And this is the boolean variable. 43 00:02:34,400 --> 00:02:37,190 The Bulan variable is just a simple variable. 44 00:02:37,190 --> 00:02:45,380 Just instead of getting a string value or getting a float value or integer value, it gets a true or 45 00:02:45,380 --> 00:02:46,280 false value. 46 00:02:46,280 --> 00:02:50,250 Only it cannot have any other type of value. 47 00:02:51,140 --> 00:02:53,690 So let's go over the definition. 48 00:02:54,080 --> 00:02:59,800 In computer science, a boolean variable can contain only one out of the two values. 49 00:02:59,810 --> 00:03:07,430 True or false, the variable is a very helpful one once we want to determine whether a certain comparison. 50 00:03:07,460 --> 00:03:08,000 All right. 51 00:03:08,340 --> 00:03:11,600 I'm just going to pause here for comparison, right. 52 00:03:13,760 --> 00:03:16,430 In a certain comparison is true or false. 53 00:03:16,850 --> 00:03:22,840 We can compare two variables using comparison operators and then get a true or false value. 54 00:03:23,420 --> 00:03:26,880 So I believe variable is just a regular variable. 55 00:03:27,660 --> 00:03:34,010 Same way as we studied before, because in Python, as we just as we discussed in earlier lectures, 56 00:03:34,340 --> 00:03:39,710 we cannot determine the type of the variable from seeing from looking at it. 57 00:03:39,800 --> 00:03:40,180 All right. 58 00:03:40,400 --> 00:03:45,710 So it's just a regular variable, but it would contain only true or false values. 59 00:03:45,710 --> 00:03:48,560 And that's how we know it's a boolean variable. 60 00:03:48,560 --> 00:03:51,890 If it has a true or false value, it is a boolean variable. 61 00:03:52,640 --> 00:03:52,960 All right. 62 00:03:52,970 --> 00:03:59,020 So from here, let's do a quick example before we go into the code and see much more examples. 63 00:03:59,450 --> 00:04:04,840 So this is an example of comparison operator and boolean variable together. 64 00:04:05,210 --> 00:04:06,510 So that's very easy. 65 00:04:06,680 --> 00:04:13,070 We have this boolean variable, which is Capablanca comparison status variable. 66 00:04:13,430 --> 00:04:15,290 It's a boolean type of variable. 67 00:04:15,500 --> 00:04:19,070 And how do we know that it is a booming variable? 68 00:04:19,370 --> 00:04:22,990 Because here we have five is bigger than six. 69 00:04:23,510 --> 00:04:29,630 So this one is a comparison operator and that's how we know that this is able and variable. 70 00:04:30,530 --> 00:04:38,480 And once we print it, all right, once we print this variable, we will get an output of false high 71 00:04:38,540 --> 00:04:43,370 because as we discussed, boolean variables can contain only true or false values. 72 00:04:43,910 --> 00:04:49,130 So that was a quick preview of theory about comparison operators and boolean variables. 73 00:04:49,400 --> 00:04:52,570 And in the next lecture, you will see much more examples. 74 00:04:52,580 --> 00:04:54,500 And that's about good guys. 75 00:04:54,500 --> 00:04:55,880 So see you in the next lecture.