1
00:00:00,150 --> 00:00:04,440
Now I'm on a hunch about the X or are logical OPERATOR OK.

2
00:00:04,440 --> 00:00:06,890
So X or.

3
00:00:07,070 --> 00:00:07,500
OK.

4
00:00:07,530 --> 00:00:14,520
So as you can see here in order to actually use the x or logical operator in your code you actually

5
00:00:14,520 --> 00:00:18,600
need to press the shift plus the number 6 on your keyboard.

6
00:00:18,600 --> 00:00:25,950
And design is the sign for X or are logical operator when you want to actually use this logical operator

7
00:00:25,950 --> 00:00:26,710
in your code.

8
00:00:26,810 --> 00:00:27,030
OK.

9
00:00:27,030 --> 00:00:30,740
Now let me actually explain what this actually logical operator does.

10
00:00:30,740 --> 00:00:34,010
The x or convention has one logical operator.

11
00:00:34,020 --> 00:00:35,810
This is the logical operator OK.

12
00:00:36,000 --> 00:00:44,280
And this results in a true value only if the boolean expressions it combines have opposite values.

13
00:00:44,380 --> 00:00:52,020
Ok if both are true or both are false they X or are logical operator produces a false value.

14
00:00:52,020 --> 00:00:57,340
OK so now let me actually show you some real examples to make this concept more clear for you.

15
00:00:57,360 --> 00:00:58,070
OK.

16
00:00:58,560 --> 00:01:05,760
So for example I want to create another variable here and that is the type of my variable is it and

17
00:01:05,820 --> 00:01:08,580
the name of my variable is for example number 1.

18
00:01:08,670 --> 00:01:09,350
OK.

19
00:01:09,600 --> 00:01:11,940
And I want to assign a value to my variable.

20
00:01:11,940 --> 00:01:14,210
For example 59.

21
00:01:14,400 --> 00:01:17,580
And then at the end of my statement I need to put in a semicolon.

22
00:01:17,580 --> 00:01:18,200
OK.

23
00:01:18,540 --> 00:01:26,850
So and here I want to actually create another variable of it a boolean data type so boolean and the

24
00:01:26,850 --> 00:01:32,940
name of my variable would be Chan boy home.

25
00:01:33,400 --> 00:01:33,910
OK.

26
00:01:34,020 --> 00:01:40,070
And then I can assign a value to my variable for example fonts and an idea of my statement.

27
00:01:40,110 --> 00:01:41,960
I need to put in a semi-colon OK.

28
00:01:42,030 --> 00:01:51,120
So now I want to actually output the value of these can by valuable to the council system that out that

29
00:01:51,120 --> 00:01:59,610
print line and then inside the prentices I just need to refer to the name of my variable can by home.

30
00:01:59,860 --> 00:02:00,500
OK.

31
00:02:00,720 --> 00:02:04,110
And then at the end of my statement I ended up with a semi-colon.

32
00:02:04,440 --> 00:02:10,940
So if I run my project now as you can see it's going to output this value to the concert OK.

33
00:02:10,980 --> 00:02:14,350
Disvalue is the value of this trend by home variable.

34
00:02:14,400 --> 00:02:23,450
Ok so now let me actually comment out this line of code here and I want to change the value of my hand

35
00:02:23,500 --> 00:02:24,760
by home variable.

36
00:02:24,870 --> 00:02:30,150
So I just need to revert to the name of my variable can by home.

37
00:02:30,930 --> 00:02:36,230
And then I can actually assign a combination of expressions to my variable.

38
00:02:36,240 --> 00:02:45,470
So the first expression would be Nahm one must be less than or equal to 50.

39
00:02:45,720 --> 00:02:46,190
OK.

40
00:02:46,230 --> 00:02:50,300
And then I use the x or logical operator as you can see here.

41
00:02:50,340 --> 00:02:50,980
OK.

42
00:02:51,300 --> 00:02:55,240
And again I create another expression here.

43
00:02:55,450 --> 00:03:00,000
Now I'm fun must be greater than 40.

44
00:03:00,180 --> 00:03:01,360
OK.

45
00:03:02,100 --> 00:03:05,760
And then at the end of my statement I need to put in a semi-colon OK.

46
00:03:06,150 --> 00:03:12,480
So now if I want to output the value of my variable to the console I just need to type in here and system

47
00:03:12,810 --> 00:03:15,370
that out that princeling.

48
00:03:16,140 --> 00:03:22,560
And then inside the apprentice's I need to refer to the name of my ABOUT can by home.

49
00:03:23,280 --> 00:03:26,610
And then at the end of my statement I need to put in a semi-colon.

50
00:03:26,700 --> 00:03:33,240
So if I run my project as you can see it's going to output this value to the council OK.

51
00:03:33,330 --> 00:03:38,700
So let me ask you to explain once again that what this logical operator does.

52
00:03:38,700 --> 00:03:39,230
OK.

53
00:03:39,300 --> 00:03:48,480
So this logical operator results in a true value only if the boolean expressions it combines have opposite

54
00:03:48,480 --> 00:03:49,140
values.

55
00:03:49,170 --> 00:03:53,310
So as you can see here these expressions are boolean expressions.

56
00:03:53,340 --> 00:03:59,940
OK we call these expressions boolean expressions because these expressions actually return a boolean

57
00:03:59,940 --> 00:04:00,390
value.

58
00:04:00,390 --> 00:04:01,480
True or false.

59
00:04:01,590 --> 00:04:04,480
OK so we call them boolean expressions.

60
00:04:04,560 --> 00:04:11,600
So this logical operator actually results in a true value only if the boolean expression is.

61
00:04:11,640 --> 00:04:14,490
It combines have opposite values.

62
00:04:14,490 --> 00:04:19,160
So as you can see here this expression here evaluates to false.

63
00:04:19,170 --> 00:04:19,920
Why.

64
00:04:19,950 --> 00:04:25,040
Because the value of the noun number one variable is greater than number.

65
00:04:25,080 --> 00:04:29,610
Fretty as you can see here 59 is greater than number 40.

66
00:04:29,680 --> 00:04:36,960
Ok but in this expression I am telling the computer that the value of the now one variable must be less

67
00:04:36,960 --> 00:04:44,230
than or equal to number 30 in order to evaluate this expression to true.

68
00:04:44,700 --> 00:04:51,780
And in this expression I am telling the computer that the value of the number one variable must be greater

69
00:04:51,780 --> 00:04:57,820
than 40 in order to evaluate this expression to true.

70
00:04:58,050 --> 00:05:01,530
So as you can see here this expression evaluates to TRUE Why.

71
00:05:01,630 --> 00:05:06,660
Because the value of the novel non-valid valuable is greater than 40.

72
00:05:06,760 --> 00:05:09,610
The value of the number one variable is fifty nine.

73
00:05:09,630 --> 00:05:12,090
OK so fifty nine is greater than 40.

74
00:05:12,220 --> 00:05:21,270
So this expression evaluates to true logical operator results in a truth value only if the boolean expressions

75
00:05:21,340 --> 00:05:24,050
it combines have opposite values.

76
00:05:24,070 --> 00:05:24,620
OK.

77
00:05:24,790 --> 00:05:28,630
So as you can see here the value of this expression evaluates to false.

78
00:05:28,630 --> 00:05:29,280
OK.

79
00:05:29,380 --> 00:05:32,190
And the value of this expression evaluates to true.

80
00:05:32,230 --> 00:05:35,940
So this logical operator results in a true value.

81
00:05:35,950 --> 00:05:36,470
Why.

82
00:05:36,580 --> 00:05:44,460
Because the boolean expressions that this logical operator combines have opposite values.

83
00:05:44,470 --> 00:05:45,160
OK.

84
00:05:45,250 --> 00:05:52,350
So this expression here evaluates to false and this expression here evaluates to true.

85
00:05:52,480 --> 00:05:56,290
So the entire expression evaluates to TRUE.

86
00:05:56,410 --> 00:05:57,390
Why.

87
00:05:57,400 --> 00:06:00,490
Because I am using this logical operator here.

88
00:06:00,580 --> 00:06:06,790
OK so this expression evaluates to false and this expression evaluates to TRUE.

89
00:06:06,880 --> 00:06:07,330
OK.

90
00:06:07,480 --> 00:06:10,170
So the entire expression evaluates to TRUE.

91
00:06:10,300 --> 00:06:10,880
Why.

92
00:06:10,990 --> 00:06:18,640
Because this operator here results in a true value only if the boolean expression is that it combines

93
00:06:18,850 --> 00:06:20,180
have opposite values.

94
00:06:20,200 --> 00:06:24,430
OK so these boolean expressions have opposite values.

95
00:06:24,430 --> 00:06:25,010
OK.

96
00:06:25,240 --> 00:06:31,170
So as you can see in the console the true value is now actually out with a to the console like so.

97
00:06:31,180 --> 00:06:39,640
Now if I for example change this value to something else for example 59 as you can see now this expression

98
00:06:39,670 --> 00:06:41,060
evaluates to TRUE.

99
00:06:41,140 --> 00:06:41,770
Why.

100
00:06:41,800 --> 00:06:48,330
Because the value of the number one variable is now equal to that to this number here.

101
00:06:48,320 --> 00:06:49,080
OK.

102
00:06:49,660 --> 00:06:54,480
The value of this number one variable is now equal to this number here.

103
00:06:54,480 --> 00:06:55,600
OK 59.

104
00:06:55,870 --> 00:07:01,690
So now if I run my project now it's going to actually be out with the false value to the console as

105
00:07:01,690 --> 00:07:03,310
you can see here.

106
00:07:03,350 --> 00:07:07,270
OK this value is the value of this variable here.

107
00:07:07,330 --> 00:07:07,810
OK.

108
00:07:07,840 --> 00:07:11,300
Why is it actually out with had the false value to the console.

109
00:07:11,440 --> 00:07:20,170
Because this logical operator here results in a true value only if the boolean expressions it combines

110
00:07:20,350 --> 00:07:22,430
have opposite values.

111
00:07:22,500 --> 00:07:30,950
Ok if both are true or both are false this logical operator here produces a false value.

112
00:07:31,060 --> 00:07:31,860
OK.

113
00:07:32,380 --> 00:07:40,190
So as you can see here both of these expressions here actually evaluates to true so.

114
00:07:40,410 --> 00:07:47,660
So the entire expression evaluates to false and that false value is assigned to this variable here.

115
00:07:47,710 --> 00:07:52,440
And as you can see here in the console this false value is now out with to the console.

116
00:07:52,480 --> 00:07:57,860
OK so now let me actually explain to you what's going on here in line 42.

117
00:07:57,970 --> 00:07:59,460
I created a variable.

118
00:07:59,470 --> 00:08:00,140
Now what.

119
00:08:00,230 --> 00:08:07,310
OK the data type of my variable is int and then I assigned a value to my variable number 59.

120
00:08:07,360 --> 00:08:08,080
OK.

121
00:08:08,350 --> 00:08:17,080
And in line 43 I created another variable with the boolean data type and I gave a name to my variable.

122
00:08:17,170 --> 00:08:19,380
For example can buy home OK.

123
00:08:19,390 --> 00:08:22,920
And I assigned a value to my valuable for example fots.

124
00:08:22,960 --> 00:08:23,620
OK.

125
00:08:23,620 --> 00:08:31,070
And in line 47 as you can see here I decided to change the value of my boolean variable.

126
00:08:31,270 --> 00:08:37,510
So I just referred to the name of my variable and then I actually put a combination of expressions here

127
00:08:38,170 --> 00:08:44,190
in order to actually assign the value of the entire expression to my variable.

128
00:08:44,230 --> 00:08:44,970
OK.

129
00:08:45,280 --> 00:08:49,740
So as you can see here the first expression here evaluates to TRUE.

130
00:08:49,860 --> 00:08:54,470
OK now one is less than or equal to the number 59.

131
00:08:54,670 --> 00:08:59,980
So the value of the number one variable is 59 and this number is 59.

132
00:09:00,070 --> 00:09:02,050
So this expression evaluates to TRUE.

133
00:09:02,080 --> 00:09:03,010
OK.

134
00:09:03,520 --> 00:09:06,640
And then I am using the logical operator as you can see.

135
00:09:07,060 --> 00:09:14,980
And then this expression again evaluates to true because the value of this non-valid valuable is greater

136
00:09:14,980 --> 00:09:16,150
than 40.

137
00:09:16,420 --> 00:09:17,000
OK.

138
00:09:17,170 --> 00:09:19,840
As you can see 59 is greater than 40.

139
00:09:19,900 --> 00:09:23,550
So this expression now evaluates to true so.

140
00:09:23,710 --> 00:09:29,840
So this operator results in a true value only if the boolean expression is.

141
00:09:29,890 --> 00:09:32,280
It combines have opposite values.

142
00:09:32,350 --> 00:09:38,890
So for example if I want to actually evaluate the entire expression through this expression here for

143
00:09:38,890 --> 00:09:41,590
example must evaluate to true.

144
00:09:42,250 --> 00:09:45,990
And this expression here must evaluate to false.

145
00:09:46,000 --> 00:09:47,080
OK.

146
00:09:47,250 --> 00:09:51,320
Or this expression here must evaluate to false.

147
00:09:51,580 --> 00:09:54,690
And this expression here must evaluate to true.

148
00:09:54,820 --> 00:10:04,500
OK this logical operator here results in true value only if the boolean expressions these are the boolean

149
00:10:04,500 --> 00:10:11,090
expressions only if the boolean expressions it combines have opposite values.

150
00:10:11,130 --> 00:10:12,780
OK so this is very important.

