Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,180 --> 00:00:05,250
OK let's build upon where we just left off with the boolean expressions.
2
00:00:05,280 --> 00:00:10,530
So now let's talk about relational operators and boolean operators.
3
00:00:10,530 --> 00:00:16,940
So what do we mean when we say operator let's go ahead and just add a new section here and we'll just
4
00:00:16,950 --> 00:00:22,680
say relational and boolean operators if you want.
5
00:00:22,680 --> 00:00:25,770
You can go ahead and just put a new line here.
6
00:00:25,800 --> 00:00:33,600
So remember we specify a new line in a function and let's say greater than let's define a variable called
7
00:00:33,630 --> 00:00:40,200
greater than and let's just make that equal to seven is greater than five.
8
00:00:41,110 --> 00:00:41,500
OK.
9
00:00:41,530 --> 00:00:48,150
So we're using a operator here with the greater than symbol right.
10
00:00:48,220 --> 00:00:54,240
And we're also using a boolean expression because when we say seven is greater than five.
11
00:00:54,760 --> 00:00:58,580
Well that's going to come back with true.
12
00:00:58,630 --> 00:01:05,170
And we could say less than we could say five is less than seven.
13
00:01:05,170 --> 00:01:19,510
And that's also going to return true What about the greater than or equal to we can say seven is greater
14
00:01:19,510 --> 00:01:21,820
than or equal to seven.
15
00:01:21,910 --> 00:01:24,210
And that's going to return true as well.
16
00:01:24,250 --> 00:01:33,190
And then if you can think of less than or equal to it's going to be very similar we say seven less than
17
00:01:33,190 --> 00:01:34,440
or equal to seven.
18
00:01:34,450 --> 00:01:36,670
And that's also going to be true.
19
00:01:37,300 --> 00:01:42,430
So if we were to print all of these out which we don't have to they're all going to return back true
20
00:01:43,720 --> 00:01:47,080
so there's other things that we can add in here.
21
00:01:47,110 --> 00:01:52,520
So what if we bring in multiple operators.
22
00:01:52,710 --> 00:01:58,710
For example we could say test and you can call this whatever you want.
23
00:01:58,710 --> 00:02:08,290
So what if we say seven is greater than five and five is less than seven.
24
00:02:09,300 --> 00:02:15,140
So we see here that this is true and this is true.
25
00:02:15,140 --> 00:02:24,320
That would make this entire statement true so you could say true here if we were to say let's just call
26
00:02:24,320 --> 00:02:36,410
this test and to we were to say seven is greater than five which is true and five is greater than seven.
27
00:02:36,410 --> 00:02:38,000
Well that's not true.
28
00:02:38,120 --> 00:02:45,950
So this whole statement is going to be false because we're going to say and and is very important here.
29
00:02:45,950 --> 00:02:46,980
Right.
30
00:02:47,000 --> 00:02:55,490
What if we were to say something like or though if we were to say let's test out or we could say seven
31
00:02:55,550 --> 00:03:02,450
is greater than five or five is less than seven.
32
00:03:03,170 --> 00:03:10,430
Well this is going to return true and if we were to do the same thing as we did above where we say test
33
00:03:10,970 --> 00:03:20,670
or two and we say seven is greater than five or five is greater than seven forgotten by parentheses
34
00:03:20,670 --> 00:03:24,630
here and this is also going to return true.
35
00:03:24,690 --> 00:03:25,640
Why.
36
00:03:25,800 --> 00:03:34,170
Because only one statement has to be true here for these both to be true in the instance of and both
37
00:03:34,200 --> 00:03:37,390
statements here have to be true in order for it to be true.
38
00:03:37,470 --> 00:03:43,110
If one of them becomes false the whole thing becomes false in the sense of or the case of.
39
00:03:43,110 --> 00:03:51,030
Or if both are true it's true if one or the other is true then it's true.
40
00:03:51,030 --> 00:03:55,540
Both have to be false for it to actually return false.
41
00:03:56,280 --> 00:04:01,910
OK so you can print these out as well to test this out.
42
00:04:01,950 --> 00:04:07,170
The other thing that we can say is we could say something like test not.
43
00:04:07,620 --> 00:04:11,220
We can say something like not true.
44
00:04:11,360 --> 00:04:11,980
And guess what.
45
00:04:11,980 --> 00:04:14,280
Not true is going to be false.
46
00:04:14,290 --> 00:04:17,400
And we said not false then that will be true.
47
00:04:17,960 --> 00:04:21,740
So these are the ones that can start to kind of get confusing.
48
00:04:22,100 --> 00:04:29,000
So again my recommendation is to make good notes on this and then go out and study it.
49
00:04:29,210 --> 00:04:31,450
And there are two false charts.
50
00:04:31,460 --> 00:04:34,070
Let's just see if we can google one quickly.
51
00:04:34,070 --> 00:04:36,100
There are true false charts online.
52
00:04:36,110 --> 00:04:50,670
We can say True False chart by phone and go to images and we can see truth tables is what they're called.
53
00:04:50,730 --> 00:04:58,110
So if A is true and B is true that a and b our true if A is false or true and B is false then they're
54
00:04:58,110 --> 00:05:02,340
both false false true is false and false false is false.
55
00:05:02,340 --> 00:05:08,230
So in order to have a truth table for and everything has to be true.
56
00:05:08,680 --> 00:05:16,150
So if we search truth tables that might give us a better chart here and then you get something sort
57
00:05:16,150 --> 00:05:25,060
of like this or you have and where you see a true true is true you have or where true false is still
58
00:05:25,060 --> 00:05:32,250
true and then X or we don't have to worry about right now so take good notes on these.
59
00:05:32,250 --> 00:05:33,490
Make sure you understand them.
60
00:05:33,510 --> 00:05:36,890
We're going to continue to build upon them over time.
61
00:05:36,900 --> 00:05:43,290
Really all you have to think about though is you have to think about boolean operators and these expressions.
62
00:05:43,290 --> 00:05:49,260
And the most important things to take away from this are not just the true and false but the greater
63
00:05:49,260 --> 00:05:51,470
than symbols the less than symbols.
64
00:05:51,480 --> 00:05:57,780
All these different types of operators that we can utilize here and that we can also utilize things
65
00:05:57,780 --> 00:06:02,310
such as and or and not as well.
66
00:06:02,310 --> 00:06:08,430
So we're just adding more tools to our toolkit and more things to think about where python is important
67
00:06:08,430 --> 00:06:11,960
when it comes to pen testing is not necessarily being able to develop.
68
00:06:11,970 --> 00:06:16,800
And I've said this before I must say it again being able to read and understand what is going on is
69
00:06:16,800 --> 00:06:18,010
super important.
70
00:06:18,060 --> 00:06:20,670
Being a developer not as important.
71
00:06:20,670 --> 00:06:25,890
So as long as you see these things and you see a true or you see a statement like this when you're reading
72
00:06:25,890 --> 00:06:30,720
code and you say hey I know that's a boolean operator I know it's true or false.
73
00:06:30,720 --> 00:06:33,960
And I kind of understand the truth tables.
74
00:06:33,960 --> 00:06:34,260
Right.
75
00:06:34,500 --> 00:06:36,540
So that's really what we're after here.
76
00:06:36,540 --> 00:06:40,770
So as long as you start getting this understanding and comprehension that's really what we're after.
77
00:06:41,160 --> 00:06:47,280
So from here we're going to move on and we're going to go into conditional statements and that is where
78
00:06:47,280 --> 00:06:52,300
we get into something called if then else and we'll have a little bit of fun with those.
79
00:06:52,320 --> 00:06:54,200
So I will catch you over in the next video.
8175
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.