1
00:00:01,480 --> 00:00:02,870
A What's up everybody.

2
00:00:02,910 --> 00:00:09,120
Mark Price at Dev slopes dot com plugging our way through foundational swift and programming and not

3
00:00:09,120 --> 00:00:14,100
only teach India SWIP but I'm teaching the underlying core programming principles that you use with

4
00:00:14,100 --> 00:00:15,570
you in any programming language.

5
00:00:15,570 --> 00:00:17,250
So this is really good stuff.

6
00:00:17,250 --> 00:00:18,270
Take it in here.

7
00:00:18,300 --> 00:00:23,600
Go ahead and open up your X code 8 and we're going to get started with a playground.

8
00:00:23,820 --> 00:00:34,860
And this one we're going to call bulls not to be confused with like a bull with horns bulls and conditionals

9
00:00:35,370 --> 00:00:51,190
and comparison operators to create a folder for this swift and say boules and comparison's

10
00:00:53,740 --> 00:00:55,060
and create.

11
00:00:55,690 --> 00:01:00,510
So a boolean is true or false.

12
00:01:00,550 --> 00:01:05,640
Simple enough so far.

13
00:01:05,830 --> 00:01:07,210
We kind of done this once before.

14
00:01:07,210 --> 00:01:07,450
Right.

15
00:01:07,450 --> 00:01:09,540
Bar.

16
00:01:09,930 --> 00:01:18,220
Am I Am i the best teacher ever equals.

17
00:01:18,220 --> 00:01:18,840
What's that.

18
00:01:20,200 --> 00:01:21,330
Jennifer says true.

19
00:01:21,400 --> 00:01:22,480
Thanks Jennifer.

20
00:01:22,480 --> 00:01:22,780
OK.

21
00:01:22,780 --> 00:01:24,590
So am I the best teacher ever.

22
00:01:25,060 --> 00:01:25,840
Well thank you.

23
00:01:25,960 --> 00:01:30,620
I wouldn't say that about myself because there will be narcissistic.

24
00:01:30,730 --> 00:01:31,600
So that's a boolean.

25
00:01:31,660 --> 00:01:32,430
It's true.

26
00:01:32,650 --> 00:01:37,190
And you know but it can also be false can't be anything else so.

27
00:01:37,480 --> 00:01:39,320
So am I the best teacher ever.

28
00:01:39,330 --> 00:01:45,940
Well let's say the ExCo just keeps crashing and you're getting sick of watching me have X code crash

29
00:01:46,150 --> 00:01:47,180
and you're just angry.

30
00:01:47,230 --> 00:01:53,860
And so now you want to set this to false because it's not my fault it is crashing.

31
00:01:53,860 --> 00:01:56,530
Don't get on my case don't get on my case.

32
00:01:56,530 --> 00:01:58,350
So am I the best teacher ever.

33
00:01:58,600 --> 00:02:06,670
I'm no longer the best teacher ever because this is up to us and you know I actually do cut out a lot

34
00:02:06,670 --> 00:02:12,760
of the a lot of the crashes but I leave some of them in there so you can know that again real life development

35
00:02:13,240 --> 00:02:14,500
you see in the flesh there.

36
00:02:14,500 --> 00:02:18,020
So am I the best teacher ever is now false because it keeps crashing.

37
00:02:18,070 --> 00:02:20,520
OK and I'm not cutting it out of the video.

38
00:02:21,250 --> 00:02:21,780
OK.

39
00:02:21,970 --> 00:02:23,830
Anyway so true or false.

40
00:02:23,860 --> 00:02:24,530
So what does that mean.

41
00:02:24,540 --> 00:02:24,950
Why does it.

42
00:02:24,970 --> 00:02:28,550
Why does it mean that we are storing a very true or false variable.

43
00:02:28,960 --> 00:02:35,080
Well the funny thing is actually most of the time you're not storing true or false values in a variable.

44
00:02:35,140 --> 00:02:38,490
You will and I do it frequently but not all the time.

45
00:02:38,680 --> 00:02:48,460
Boolean values are sometimes more so used to just compare things or to to do something based on some

46
00:02:48,460 --> 00:02:49,290
condition.

47
00:02:49,530 --> 00:02:50,940
OK.

48
00:02:51,400 --> 00:02:51,670
Right.

49
00:02:51,670 --> 00:02:54,190
Does that make any sense you want to do something based.

50
00:02:54,220 --> 00:02:55,030
Should I do this.

51
00:02:55,030 --> 00:03:01,960
You know if you know when you were a kid remember when you were a kid and your parents were like Yo

52
00:03:02,200 --> 00:03:07,510
if you clean your room and do your chores we're going to go to Disneyland otherwise I'm going to take

53
00:03:07,510 --> 00:03:10,020
this big black belt with these spikes on it.

54
00:03:10,030 --> 00:03:15,520
I'm going to beat you a rough childhood anyway.

55
00:03:15,890 --> 00:03:17,890
Cause and effect or true or false.

56
00:03:18,110 --> 00:03:21,000
Is a foundational principle for that.

57
00:03:21,700 --> 00:03:27,250
And this is again type inference here we're inferring it as a bull but the actual key word if you want

58
00:03:27,250 --> 00:03:30,470
to explicitly declare it is bull.

59
00:03:30,550 --> 00:03:30,960
OK.

60
00:03:31,030 --> 00:03:32,580
Not bullying.

61
00:03:32,830 --> 00:03:33,860
OK.

62
00:03:33,880 --> 00:03:37,990
Not bullying literal type convert what nothing else OK just bull and I'm not going explain what these

63
00:03:38,110 --> 00:03:38,520
things are.

64
00:03:38,520 --> 00:03:42,970
If you're wondering what's the difference between bullying bullying and swift on the part when them

65
00:03:43,180 --> 00:03:44,280
autocomplete comes up.

66
00:03:44,350 --> 00:03:45,900
Go search on Google.

67
00:03:45,940 --> 00:03:47,970
I'm telling you all you need to do is blog.

68
00:03:48,190 --> 00:03:48,930
OK.

69
00:03:49,270 --> 00:03:50,730
So true or false.

70
00:03:50,830 --> 00:03:52,180
And how can you use these things.

71
00:03:52,180 --> 00:03:52,510
Well

72
00:03:56,470 --> 00:03:57,560
to make decisions for you.

73
00:03:57,560 --> 00:04:00,740
So that's it.

74
00:04:00,820 --> 00:04:02,150
That's bull.

75
00:04:02,830 --> 00:04:03,920
Let's put them in action.

76
00:04:03,940 --> 00:04:08,900
Let's actually see how we can use comparisons with.

77
00:04:09,250 --> 00:04:10,990
Well I can say one more thing actually.

78
00:04:11,440 --> 00:04:12,330
Just one more thing.

79
00:04:12,430 --> 00:04:13,210
OK.

80
00:04:13,570 --> 00:04:15,850
Just to blow your mind confuse you completely.

81
00:04:16,120 --> 00:04:30,490
If true equals false or if true equals true print WDF this is what the fish.

82
00:04:30,490 --> 00:04:31,810
By the way.

83
00:04:31,810 --> 00:04:33,710
All right.

84
00:04:34,060 --> 00:04:35,310
What's going on here.

85
00:04:35,710 --> 00:04:39,670
So we're using the double equals sign here.

86
00:04:39,670 --> 00:04:43,280
This is a comparison operator and this is called equal to.

87
00:04:43,360 --> 00:04:47,200
So if true is equal to false.

88
00:04:47,260 --> 00:04:48,080
OK.

89
00:04:48,670 --> 00:04:53,030
If true or false then this whole side of the equation would be true but it's not.

90
00:04:53,030 --> 00:05:01,420
So this whole side of the equation is false so we're saying if false or OK this is the or OPERATOR OK

91
00:05:02,590 --> 00:05:06,260
and or if true equals true.

92
00:05:06,400 --> 00:05:10,440
So if this is true or if this is true then go into here.

93
00:05:10,900 --> 00:05:11,500
OK.

94
00:05:11,650 --> 00:05:13,270
So true is definitely equal to true.

95
00:05:13,270 --> 00:05:16,540
So this is going to return the entire section over here to true.

96
00:05:16,840 --> 00:05:24,490
And so again you can start to see maybe how you can start comparing things in your code.

97
00:05:24,790 --> 00:05:31,180
And this is a great example because you probably wouldn't write this in your code but a lot of coding

98
00:05:31,180 --> 00:05:36,600
tests and brainteasers out there will actually ask you to decide for things like this.

99
00:05:36,610 --> 00:05:40,290
So you're you can they can see how your brain works and see if you can read the code.

100
00:05:40,420 --> 00:05:42,480
This is really good for learning how to read code.

101
00:05:42,610 --> 00:05:43,060
OK.

102
00:05:43,150 --> 00:05:45,080
So true or false.

103
00:05:45,460 --> 00:05:52,390
You know a better example is for instance var has data finished downloading.

104
00:05:52,390 --> 00:05:57,860
You know how when you get an app and there's a spinner bar was explicitly declare it.

105
00:05:58,150 --> 00:05:59,610
So you know it's a boolean.

106
00:05:59,620 --> 00:06:04,150
So basically when you get that spinner bar it's hitting up a server and it's downloading data.

107
00:06:04,150 --> 00:06:04,710
OK.

108
00:06:04,870 --> 00:06:08,410
So you know we've got the spinner and dot dot dot you know.

109
00:06:08,720 --> 00:06:10,100
Little color that was nice.

110
00:06:10,100 --> 00:06:12,040
Got.

111
00:06:12,640 --> 00:06:14,250
That's funny.

112
00:06:14,240 --> 00:06:14,910
Let's just pick a car.

113
00:06:14,920 --> 00:06:17,370
I don't know what it's doing to be honest but I like it.

114
00:06:19,580 --> 00:06:22,110
It's a feature of a feature of the playgrounds anyway.

115
00:06:22,130 --> 00:06:27,200
So we're downloading data from the internet then after it's done downloading we can say has data finished

116
00:06:27,200 --> 00:06:29,080
downloading equals true.

117
00:06:29,210 --> 00:06:29,730
All right.

118
00:06:29,870 --> 00:06:35,640
And then we can do something like no load UI and other features.

119
00:06:35,960 --> 00:06:42,380
So this is an example of when you actually use a ball in your code and in your projects with for things

120
00:06:42,380 --> 00:06:48,130
like this and I've done things like this before it's nothing wrong with it it's a common thing to do.

121
00:06:48,160 --> 00:06:48,830
So it's boolean.

122
00:06:48,830 --> 00:06:49,930
True or false.

123
00:06:49,940 --> 00:06:56,570
It's one way you can use it again anytime anytime you need to get a true false yes or no Bullen's the

124
00:06:56,570 --> 00:07:05,180
way to go for short the bulls go hand in hand or boolean logic goes hand in hand with comparison operators

125
00:07:05,330 --> 00:07:08,980
now can comparison operators will return a boolean.

126
00:07:10,010 --> 00:07:10,470
OK.

127
00:07:10,550 --> 00:07:16,700
When I say and it is bull but bullying is a long term for it with just condense it here.

128
00:07:16,690 --> 00:07:32,250
So for instance this is really easy if one is equal to two print should not see this.

129
00:07:33,980 --> 00:07:36,630
So will never be executed.

130
00:07:36,650 --> 00:07:37,630
Thank you.

131
00:07:37,640 --> 00:07:38,450
It's smart.

132
00:07:38,510 --> 00:07:39,910
So if one equals two.

133
00:07:40,070 --> 00:07:42,290
Well one is not equal to two in the recall.

134
00:07:42,290 --> 00:07:44,300
So again this returns a boolean.

135
00:07:44,610 --> 00:07:45,130
OK.

136
00:07:45,350 --> 00:07:46,570
That's really interesting huh.

137
00:07:46,910 --> 00:07:49,150
I wonder do you think you could do something like that over here.

138
00:07:49,160 --> 00:07:52,490
Actually an in a in a boolean itself.

139
00:07:52,500 --> 00:07:59,570
So what if we said instead of saying false we'll say Well said This has data finished downloading equals

140
00:07:59,660 --> 00:08:01,010
one equals two

141
00:08:04,000 --> 00:08:05,710
interesting.

142
00:08:05,710 --> 00:08:09,790
So like I said this is returning a boolean true or false value that's been stored in here.

143
00:08:09,790 --> 00:08:16,060
So like I was telling you earlier if you use them less here and variables and you use them more in conditional

144
00:08:16,060 --> 00:08:16,750
logic.

145
00:08:16,930 --> 00:08:17,720
OK.

146
00:08:18,020 --> 00:08:22,720
They return them but only return a boolean for the sake of performing.

147
00:08:22,720 --> 00:08:23,900
Making a decision.

148
00:08:24,180 --> 00:08:24,450
OK.

149
00:08:24,460 --> 00:08:30,250
So if one equals to print you should see this if two equals two.

150
00:08:30,250 --> 00:08:31,090
Now we're seeing it.

151
00:08:31,180 --> 00:08:31,760
OK.

152
00:08:32,100 --> 00:08:38,810
So it returns a true or false value conditional conditional logic.

153
00:08:38,810 --> 00:08:39,070
OK.

154
00:08:39,080 --> 00:08:40,860
So let's talk about the different operators here.

155
00:08:40,970 --> 00:08:41,460
All right.

156
00:08:41,780 --> 00:08:46,770
So we've got equal to and it's the equal sign.

157
00:08:47,150 --> 00:08:56,680
We've got not equal to which is the exclamation point and the equal sign not equal to.

158
00:08:56,690 --> 00:09:04,250
All right we've got greater then and this is you know a that's greater than B.

159
00:09:04,520 --> 00:09:07,120
So I say that's greater then.

160
00:09:07,160 --> 00:09:09,740
And I forgot my call and be consistent.

161
00:09:10,280 --> 00:09:20,280
And then we've got greater greater than or equal to which is you know the big Pacman mouth to the left

162
00:09:20,500 --> 00:09:26,680
equal to and then we have less than or equal to

163
00:09:29,670 --> 00:09:30,580
like so.

164
00:09:31,170 --> 00:09:34,820
And then we've got less than two.

165
00:09:35,030 --> 00:09:35,360
OK.

166
00:09:35,460 --> 00:09:39,710
So obviously there's a lot going on here but let's see how it actually works.

167
00:09:39,770 --> 00:09:40,650
Let's see it in action.

168
00:09:40,650 --> 00:09:41,140
OK.

169
00:09:41,460 --> 00:09:48,330
So you know of course the common example here that we've used already is a bank account so we can obviously

170
00:09:48,330 --> 00:09:58,950
do that here again so our bank balance right equals are equals five $400 gave our item to buy equals

171
00:09:59,080 --> 00:10:00,150
$100.

172
00:10:00,350 --> 00:10:01,140
OK.

173
00:10:01,370 --> 00:10:09,930
So then what we can do is we can say if bank balance bank balance is greater than or equal to item to

174
00:10:09,930 --> 00:10:16,320
buy Why wouldn't we just say if it's greater then well the buyer was $400 this would turn out to be

175
00:10:16,320 --> 00:10:17,790
false and we would be able to buy it.

176
00:10:17,790 --> 00:10:18,610
That's not right.

177
00:10:18,630 --> 00:10:23,670
We need to be able to go to zero dollars in our account but not into the negative unless you turn unless

178
00:10:23,670 --> 00:10:26,480
you put an overdraft protection you know which.

179
00:10:26,520 --> 00:10:27,820
Why did people do that.

180
00:10:27,840 --> 00:10:29,060
No frigging clue.

181
00:10:29,070 --> 00:10:30,000
Just what I wanted to do.

182
00:10:30,000 --> 00:10:36,830
I wanted to spend money I didn't have get the item and then have you charge me a negative fee.

183
00:10:36,840 --> 00:10:40,500
I mean I guess if you want to be embarrassed at the register because your card didn't go through and

184
00:10:40,500 --> 00:10:43,780
you're like I'm sorry sir your card didn't go through Was everything OK.

185
00:10:43,800 --> 00:10:46,580
Do you need any help with your family.

186
00:10:46,620 --> 00:10:47,340
No.

187
00:10:47,400 --> 00:10:53,300
So anyway my point is we need the equal sign so we can actually buy that item the item to buy.

188
00:10:53,980 --> 00:10:54,450
OK.

189
00:10:54,660 --> 00:10:57,480
Then print purchased item.

190
00:10:57,690 --> 00:10:58,480
OK.

191
00:10:58,500 --> 00:11:05,250
So if you've got more money or equal to or an equal amount of money I'd buy print purchase item.

192
00:11:05,280 --> 00:11:15,930
Another thing we could do you know we could say if item to buy is greater than the bank balance

193
00:11:19,100 --> 00:11:23,030
you need more money.

194
00:11:23,760 --> 00:11:24,470
OK.

195
00:11:24,710 --> 00:11:25,130
So

196
00:11:28,350 --> 00:11:32,490
if Ireland buy is great for the balance you need more money for this and we're using a greater than

197
00:11:32,490 --> 00:11:33,090
only sign.

198
00:11:33,120 --> 00:11:36,940
So let's say that having to buy is now five hundred dollars.

199
00:11:37,800 --> 00:11:39,450
Sure enough it prints out right here.

200
00:11:39,690 --> 00:11:43,140
OK this is cool so so far we've used greater than or equal to.

201
00:11:43,260 --> 00:11:47,460
We've also used the greater than sign here.

202
00:11:47,710 --> 00:11:48,560
OK.

203
00:11:48,690 --> 00:11:58,440
And maybe maybe your bank whenever you whenever you hit zero for instance it wants to give you a notification

204
00:11:58,440 --> 00:12:01,600
saying hey you're in no money you spend it all.

205
00:12:01,600 --> 00:12:08,900
You know so you know this is a silly example but we can say if item to buy is equal to bank balance.

206
00:12:09,060 --> 00:12:10,110
OK.

207
00:12:10,280 --> 00:12:19,750
And then what we can do is we can say print Hey buddy your balance is now zero.

208
00:12:20,240 --> 00:12:21,090
OK.

209
00:12:21,210 --> 00:12:28,580
So I'd advise the bank balance Hey buddy your balance is now zero so if I say I'm the buy is $400.

210
00:12:29,340 --> 00:12:30,720
Hey buddy your balance is now zero.

211
00:12:30,720 --> 00:12:35,730
So if this is equal to this OK then do this.

212
00:12:35,730 --> 00:12:42,680
Now remember remember these operators here OK are returning a true or false value.

213
00:12:42,930 --> 00:12:43,230
OK.

214
00:12:43,230 --> 00:12:46,300
So remember you could actually store this in a variable.

215
00:12:46,350 --> 00:12:55,890
So for instance var am I at zero equals I want to buy people's bank balance.

216
00:12:55,930 --> 00:12:56,210
OK.

217
00:12:56,220 --> 00:13:01,410
So it's going to run this operation first and then what it's going to do is it's going to return a true

218
00:13:01,410 --> 00:13:02,910
or false value into this.

219
00:13:02,910 --> 00:13:03,680
And this is a bull.

220
00:13:03,690 --> 00:13:06,050
And so you can actually store the result if you want it to.

221
00:13:06,060 --> 00:13:08,860
But again like I said in most cases you don't.

222
00:13:08,870 --> 00:13:09,630
OK.

223
00:13:09,780 --> 00:13:13,010
And then let's see here.

224
00:13:13,020 --> 00:13:20,190
The only other one of great importance is the not equal to sign so I'll show you that as well to friends

225
00:13:20,190 --> 00:13:23,300
and also we want to compare instead of numbers we want to compare strings.

226
00:13:23,520 --> 00:13:38,420
So if let's say correct spelling is not equal to.

227
00:13:38,670 --> 00:13:47,090
And let's actually let's better save our word one equals Let's get say let's say this are book titles.

228
00:13:47,130 --> 00:14:07,520
So book title one equals let's say Harry Potter and the Moffit of Mier on my book.

229
00:14:07,830 --> 00:14:08,070
OK.

230
00:14:08,070 --> 00:14:14,670
Anyway and then we have a book titled two equals unless we have the same thing here but this one's entered

231
00:14:14,670 --> 00:14:15,580
by a user.

232
00:14:15,630 --> 00:14:18,760
OK this one was entered by a user they knew would be the same thing right.

233
00:14:18,990 --> 00:14:23,430
So let's say that the user action in lowercase this and you know if you got the A.

234
00:14:23,550 --> 00:14:24,930
You know this bad spelling.

235
00:14:24,930 --> 00:14:38,910
So we can do is we can say if Book Title One is not equal to book title to you know print need to fix

236
00:14:38,910 --> 00:14:42,980
spelling before printing whatever.

237
00:14:43,600 --> 00:14:44,080
OK.

238
00:14:44,370 --> 00:14:48,920
So if this one is not the same as this one then do something else.

239
00:14:48,930 --> 00:14:49,650
OK.

240
00:14:49,910 --> 00:14:53,810
So it's basically the opposite of using these here.

241
00:14:53,820 --> 00:14:54,070
OK.

242
00:14:54,090 --> 00:14:57,100
And you can you'll see programmers use these interchangeably.

243
00:14:57,150 --> 00:15:02,640
And you can kind of sometimes you can do to get the same result in decision using different operators

244
00:15:02,820 --> 00:15:05,020
just depending on what you put first or second.

245
00:15:05,040 --> 00:15:08,260
But you can do whatever one you want which is cool.

246
00:15:08,260 --> 00:15:09,830
So this is all really cool.

247
00:15:09,870 --> 00:15:13,680
This is really cool stuff.

248
00:15:13,680 --> 00:15:19,910
Another thing you can do is remember how we did this example up here has data finish downloading.

249
00:15:19,970 --> 00:15:29,040
You can also use that unary operators so we could say if our first let's let's do it with stood up here

250
00:15:30,270 --> 00:15:31,860
before it's been set to true.

251
00:15:31,920 --> 00:15:38,040
So if not has data finished downloading.

252
00:15:38,460 --> 00:15:44,840
OK then print loading data.

253
00:15:45,630 --> 00:15:50,850
So at this point in time if the data has not finished downloading let's print to the screen loading

254
00:15:50,850 --> 00:15:51,120
data.

255
00:15:51,120 --> 00:15:56,490
So this is the operator put before the boolean value.

256
00:15:56,490 --> 00:15:57,990
And so it's saying the opposite right.

257
00:15:58,020 --> 00:16:03,780
So that's why it's so important to word your variables with your Bulleen so carefully so has data finish

258
00:16:03,780 --> 00:16:04,340
downloading.

259
00:16:04,350 --> 00:16:05,490
That's the question we're asking.

260
00:16:05,490 --> 00:16:09,660
So if the data has not finished eling that's what this is saying here.

261
00:16:09,660 --> 00:16:10,760
Print this here.

262
00:16:10,960 --> 00:16:13,140
OK print loading data.

263
00:16:13,140 --> 00:16:14,430
Pretty cool stuff right.

264
00:16:14,430 --> 00:16:18,120
So what we've done here so far is we've just used some of the basic operators of course we've used the

265
00:16:18,120 --> 00:16:20,900
greater than or equal to you can also use the less than or equal to.

266
00:16:20,970 --> 00:16:26,370
And you can start making decisions based on those operators.

267
00:16:26,370 --> 00:16:32,690
OK the result of those operators which is I think pretty dang cool.

268
00:16:32,700 --> 00:16:35,940
One more thing I want to show you and then we'll be done.

269
00:16:35,940 --> 00:16:40,020
So if book A 1 is not what the book title to.

270
00:16:40,590 --> 00:16:44,500
OK then we need to fix spelling before printing great else.

271
00:16:44,600 --> 00:16:45,450
Here's the key word.

272
00:16:45,450 --> 00:16:49,000
So if this happens or if this is true great.

273
00:16:49,020 --> 00:16:54,590
If not go to the next block of code and this will always always always be executed.

274
00:16:54,750 --> 00:17:02,160
If this is false and this will never ever ever be executed if this is true it very important to know.

275
00:17:02,400 --> 00:17:08,510
And so you say print book looks great send to printer.

276
00:17:09,740 --> 00:17:11,170
Pretty cool.

277
00:17:12,410 --> 00:17:13,270
Put her on.

278
00:17:13,290 --> 00:17:19,630
It's not what the book title too great we can do more though like we can also say so.

279
00:17:19,700 --> 00:17:24,060
If so the first thing we want to do is check the spelling then what we want to do is we want to make

280
00:17:24,060 --> 00:17:28,740
sure that the size of the book title is a proper size what we can say.

281
00:17:28,740 --> 00:17:30,080
Else if.

282
00:17:30,080 --> 00:17:30,770
OK.

283
00:17:30,870 --> 00:17:37,410
Book Title One dot see her length on the string here.

284
00:17:41,040 --> 00:17:41,610
See

285
00:17:53,690 --> 00:18:04,020
and far here oh characters has the string and the characters and the cat her goodness so if the count

286
00:18:04,050 --> 00:18:13,710
of the entire string is greater then let's say 10 like then we need to do is print find a new title

287
00:18:13,710 --> 00:18:15,170
for the book.

288
00:18:16,080 --> 00:18:16,700
OK.

289
00:18:17,340 --> 00:18:18,690
So that's interesting.

290
00:18:18,690 --> 00:18:24,710
So look what we did here in the book one title or the book title one is not equal to book title to them

291
00:18:24,710 --> 00:18:26,490
we need to send us the printing.

292
00:18:26,490 --> 00:18:27,880
Well let's say that we fixed it.

293
00:18:27,900 --> 00:18:29,730
All right so this is great we've just fixed it.

294
00:18:29,730 --> 00:18:34,400
The book is now perfectly edited whatever.

295
00:18:34,560 --> 00:18:35,520
But look here.

296
00:18:35,520 --> 00:18:37,450
Find a new title for your book is now called.

297
00:18:37,470 --> 00:18:38,020
OK.

298
00:18:38,280 --> 00:18:40,740
So we passed the first one this is true.

299
00:18:40,800 --> 00:18:47,380
So then we go to the next thing or excuse me this is false and therefore it's not called.

300
00:18:47,610 --> 00:18:48,600
This is false.

301
00:18:48,600 --> 00:18:56,250
So ELSE IF book titled two characters that count is greater than 10 oh no we need to find a new title

302
00:18:56,250 --> 00:18:56,570
for the book.

303
00:18:56,570 --> 00:18:58,280
This is too long it's not going to fit on the book.

304
00:18:58,500 --> 00:19:04,860
OK so we need a book that has nine characters in order in order to get to here to the else clause so

305
00:19:05,430 --> 00:19:10,930
let's say one two three four five count the space that the character six seven eight nine.

306
00:19:11,080 --> 00:19:18,160
Oh wow so Harry Potter and the muppet of fire was ternary below.

307
00:19:18,290 --> 00:19:24,870
There's books about anymore but the editors thought it might be a little more appropriate to add a G

308
00:19:24,870 --> 00:19:25,480
there instead.

309
00:19:25,480 --> 00:19:32,400
So we've got some crazy book that we've released the title on and now look see if we pass it here.

310
00:19:32,400 --> 00:19:37,220
So if book titled to the characters that count is greater than 10.

311
00:19:37,350 --> 00:19:43,650
Print a new title for the book and of course we need to copy this over here because it needs to be the

312
00:19:43,650 --> 00:19:45,530
same.

313
00:19:46,190 --> 00:19:49,170
So a book title is not equal to a book title to.

314
00:19:49,200 --> 00:19:53,370
Well it is so this is false we're not going to call this LCF book title that characters that count is

315
00:19:53,370 --> 00:19:54,380
greater than 10.

316
00:19:54,420 --> 00:19:56,080
We fix that problem too.

317
00:19:56,100 --> 00:19:57,660
So this isn't going to be false.

318
00:19:57,780 --> 00:20:03,420
So here's the end all catch all so once we pass those conditions it is now true and we're able to print

319
00:20:03,420 --> 00:20:04,040
the book.

320
00:20:04,190 --> 00:20:04,460
OK.

321
00:20:04,470 --> 00:20:08,390
So we work with if statements else if statements else statements.

322
00:20:08,390 --> 00:20:12,020
We've worked with these conditional operators here.

323
00:20:12,140 --> 00:20:12,590
OK.

324
00:20:12,620 --> 00:20:15,360
That double equals the greater than the greater than equal to.

325
00:20:15,360 --> 00:20:20,960
We've also talked about less and less than or equal to we know a lot of stuff here.

326
00:20:21,030 --> 00:20:25,840
We've talked about the urinary not OPERATOR OK the prefix here.

327
00:20:26,010 --> 00:20:33,030
If it's not finished downloading we're talking about booleans and true and false and how this will equate

328
00:20:33,030 --> 00:20:34,860
to a true or false.

329
00:20:34,890 --> 00:20:36,740
Some really good stuff so we're going to call this video done.

330
00:20:36,740 --> 00:20:37,680
It's a lot to take in.

331
00:20:37,680 --> 00:20:43,770
Watch it again and you're going to start using conditions in your applications because that's how applications

332
00:20:43,870 --> 00:20:48,870
think and make decisions is by using tools.

333
00:20:49,000 --> 00:20:51,410
Mark Price Loeb's dotcom.

334
00:20:51,460 --> 00:20:52,630
Moving on and for.

