1
00:00:05,320 --> 00:00:08,750
So now that we've actually installed and
configured Python and set up IntelliJ,

2
00:00:08,750 --> 00:00:11,980
it's time to start talking about and
using Python.

3
00:00:11,980 --> 00:00:14,920
First I wanna give you a little
bit of an introduction of Python.

4
00:00:14,920 --> 00:00:18,050
Now it's actually an object
orientated interpreted language.

5
00:00:18,050 --> 00:00:21,040
And really it's quite easy to
use in terms of other languages.

6
00:00:21,040 --> 00:00:25,890
And also runs on a lot of, many operating
systems, including Mac, Windows,

7
00:00:25,890 --> 00:00:28,760
Linux, and quite a few other ones as well.

8
00:00:28,760 --> 00:00:31,970
It's interesting, it's actually
named after the cult comedy show

9
00:00:31,970 --> 00:00:34,980
Monty Python's Flying Circus,
but [LAUGH] not after the snake.

10
00:00:34,980 --> 00:00:37,990
And you'll find actually various
references to Monty Python's sketches in

11
00:00:37,990 --> 00:00:39,380
the official documentation.

12
00:00:39,380 --> 00:00:42,370
The good thing about Python is that it
supports a lot of basic data types,

13
00:00:42,370 --> 00:00:44,030
such as numbers and strings.

14
00:00:44,030 --> 00:00:46,960
But also, it supports more complex types,
like lists and

15
00:00:46,960 --> 00:00:49,830
dictionaries, that can greatly
simplify data processing.

16
00:00:49,830 --> 00:00:51,340
And you'll find out more about that, and

17
00:00:51,340 --> 00:00:53,400
about those data types as
you move through the course.

18
00:00:53,400 --> 00:00:56,790
As I mentioned it's object-orientated,
so it does support that fully and

19
00:00:56,790 --> 00:01:01,190
allows multiple inheritance, which may be
nothing to you at this point in time, but

20
00:01:01,190 --> 00:01:02,420
believe me, it's a good feature, and

21
00:01:02,420 --> 00:01:04,519
you'll be learning about that
through the course as well.

22
00:01:04,519 --> 00:01:07,190
The other thing is that the data
in Python is strongly typed, so

23
00:01:07,190 --> 00:01:11,060
what I mean by that is for example,
if you attempt to add a number.

24
00:01:11,060 --> 00:01:15,050
And a string, you'll actually get an
error, but it's also dynamically topped,

25
00:01:15,050 --> 00:01:17,980
so you're free from worrying
about variable declarations,

26
00:01:17,980 --> 00:01:21,390
and again I'll be explaining that
fully as we go through the course.

27
00:01:21,390 --> 00:01:24,840
Now despite the fact that it's quite
easy to use, it's also very powerful.

28
00:01:24,840 --> 00:01:28,370
Interestingly enough, it's one of the
three official languages used to Google.

29
00:01:28,370 --> 00:01:32,020
Now the creator of Python, Guido van
Rossum, hope I got the pronunciation

30
00:01:32,020 --> 00:01:34,640
correct, he actually worked for
Google for over seven years and

31
00:01:34,640 --> 00:01:38,150
he was actually allowed to spend half his
time developing Python while he was there.

32
00:01:38,150 --> 00:01:41,230
Now one important consideration
before we get into the code, and

33
00:01:41,230 --> 00:01:45,450
I promise you we are getting into the code
is that the Python team decided to break

34
00:01:45,450 --> 00:01:47,760
backwards compatibility
when they created Python 3.

35
00:01:47,760 --> 00:01:50,350
So while it's very similar to Python 2,
and

36
00:01:50,350 --> 00:01:54,380
a lot of programs will work in Python 3,
there's no longer any guarantee

37
00:01:54,380 --> 00:01:58,010
that Python 2 programs will actually
work with the Python 3 interpreter.

38
00:01:58,010 --> 00:02:00,430
And the other thing to
know is that there's no

39
00:02:00,430 --> 00:02:02,190
further development
happening with Python 2.

40
00:02:02,190 --> 00:02:05,900
So in other words, version 2.7
of Python is the final version.

41
00:02:05,900 --> 00:02:09,870
But with that said, they're gonna continue
to support it until at least 2020.

42
00:02:09,870 --> 00:02:13,800
But, it's really for that reason that
we chose Python 3 as the way forward.

43
00:02:13,800 --> 00:02:17,630
And a lot of the code is going to work
okay for python 2, and many systems

44
00:02:17,630 --> 00:02:21,490
are running it, but there are differences
as you'll find in version 2 and version 3.

45
00:02:21,490 --> 00:02:25,230
So as they come up, we'll actually talk
about those differences in this course, so

46
00:02:25,230 --> 00:02:28,310
you can come away with a good
understanding if you are in the situation

47
00:02:28,310 --> 00:02:32,190
of having to get to the tricky part of two
code working after completing this course.

48
00:02:32,190 --> 00:02:34,130
Anyway enough with the introductions.

49
00:02:34,130 --> 00:02:36,260
Let's get into actually
creating some code.

50
00:02:36,260 --> 00:02:37,660
So have your InteliJ open.

51
00:02:37,660 --> 00:02:39,340
So we're gonna create a new project now,
so

52
00:02:39,340 --> 00:02:40,990
we can start playing around with Python.

53
00:02:40,990 --> 00:02:43,650
And to do that I'm gonna
click on Create New Project.

54
00:02:43,650 --> 00:02:47,990
And if you recall in the previous video
I actually configured the project SDK.

55
00:02:47,990 --> 00:02:49,640
So that we were able
to start using Python.

56
00:02:49,640 --> 00:02:50,940
So, that's configured.

57
00:02:50,940 --> 00:02:54,330
So make sure you're selecting Python
as the type we're going to be using.

58
00:02:54,330 --> 00:02:55,300
The project type.

59
00:02:55,300 --> 00:02:56,420
Click on Next.

60
00:02:56,420 --> 00:02:57,760
I'm not gonna click on
any of those options.

61
00:02:57,760 --> 00:02:59,360
I'm gonna leave them as the defaults.

62
00:02:59,360 --> 00:03:00,720
Click on Next.

63
00:03:00,720 --> 00:03:03,090
And next I need to know the folder
where I'm going to be putting my files.

64
00:03:03,090 --> 00:03:07,040
And what I'm going to do is create
a new folder structure to put all my

65
00:03:07,040 --> 00:03:07,550
Python code.

66
00:03:07,550 --> 00:03:09,440
I'm gonna click on these
three little buttons here.

67
00:03:09,440 --> 00:03:12,660
And I'm gonna click on a folder that
I've got from my various courses and

68
00:03:12,660 --> 00:03:16,040
I'm gonna click on PythonPrograms.

69
00:03:16,040 --> 00:03:19,880
So, that's my new folder that I'm going
to be creating all my projects in.

70
00:03:19,880 --> 00:03:23,020
And each time I create
another Python program,

71
00:03:23,020 --> 00:03:24,850
I'm gonna put it in it
s own separate folder.

72
00:03:26,000 --> 00:03:28,110
And notice when I did that the first time,

73
00:03:28,110 --> 00:03:30,600
IntelliJ doesn't quite get
this right cuz it's assuming,

74
00:03:30,600 --> 00:03:33,540
by the actual path that I created,
that that's what I wanna call above.

75
00:03:33,540 --> 00:03:36,710
What I need to do is actually delete
that and we'll call it HelloWorld.

76
00:03:36,710 --> 00:03:41,610
It's gonna be our very first program and
what I'll need to do is because I'm

77
00:03:41,610 --> 00:03:44,950
actually in here, I need to
actually type in HelloWorld there.

78
00:03:44,950 --> 00:03:45,550
So in other words,

79
00:03:45,550 --> 00:03:50,190
the path is Programs/PythonPrograms and
the project is HelloWorld.

80
00:03:50,190 --> 00:03:53,520
And what will happen is IntelliJ
will create that new folder for

81
00:03:53,520 --> 00:03:54,360
us automatically.

82
00:03:54,360 --> 00:03:57,920
Now, depending on whether you got this
button or this option clicked down here,

83
00:03:57,920 --> 00:04:01,250
that may be open or close, these
are the options that may come up, but

84
00:04:01,250 --> 00:04:02,900
you can safely ignore all of those.

85
00:04:02,900 --> 00:04:06,590
The main thing is the project location,
where you wanna save your files, and

86
00:04:06,590 --> 00:04:07,180
the project name.

87
00:04:07,180 --> 00:04:09,830
Again, this doesn't really matter to
this day, but we're gonna go ahead and

88
00:04:09,830 --> 00:04:10,540
call it HelloWorld.

89
00:04:10,540 --> 00:04:12,480
So we're gonna click on Finish.

90
00:04:12,480 --> 00:04:15,330
And IntelliJ will come and say,
do you want me to create that folder?

91
00:04:15,330 --> 00:04:17,089
Well, that's yes,
we do want you to do that.

92
00:04:17,089 --> 00:04:18,529
So I'm gonna click OK.

93
00:04:18,529 --> 00:04:20,560
And actually create it for
us and IntelliJ will open up.

94
00:04:20,560 --> 00:04:25,280
And what I'm gonna do is go
into presentation mode, so

95
00:04:25,280 --> 00:04:27,470
it's easy for you to see what I'm typing.

96
00:04:27,470 --> 00:04:31,110
And the other thing to do which, note that
IntelliJ has selected that anyway, but

97
00:04:31,110 --> 00:04:33,150
make sure that project view is selected.

98
00:04:33,150 --> 00:04:36,080
That's the easiest one to never get
through your various false trackers that

99
00:04:36,080 --> 00:04:37,660
you'll need to do doing this course.

100
00:04:37,660 --> 00:04:40,170
So I'm gonna click on that and
I'm gonna open this up.

101
00:04:40,170 --> 00:04:41,260
And we're actually ready to go.

102
00:04:41,260 --> 00:04:45,190
So what we're gonna do first, we're
gonna go and create a new python file.

103
00:04:45,190 --> 00:04:49,870
So we've created a project, and a project
can contain a number of different files.

104
00:04:49,870 --> 00:04:53,230
We're gonna create a python file, so
we can actually type some code in.

105
00:04:53,230 --> 00:04:55,300
So to do that, we're gonna click on,
go to the File menu.

106
00:04:56,610 --> 00:04:58,800
Click on New, and then select Python File.

107
00:04:59,840 --> 00:05:02,790
And notice that the kind is
automatically selected, python file.

108
00:05:02,790 --> 00:05:05,960
We're gonna type in HelloWorld.

109
00:05:05,960 --> 00:05:08,010
And we're gonna go press Enter or
I'm gonna click OK.

110
00:05:08,010 --> 00:05:09,840
>> And
we've now got some code on the screen.

111
00:05:09,840 --> 00:05:13,300
So you notice that in line 1,
IntelliJ has added that automatically.

112
00:05:13,300 --> 00:05:16,330
It's added the username for
the particular machine that you're on.

113
00:05:16,330 --> 00:05:17,500
So you can safely ignore that.

114
00:05:17,500 --> 00:05:19,180
That'll be added automatically.

115
00:05:19,180 --> 00:05:20,380
So let's actually put some code in.

116
00:05:20,380 --> 00:05:22,090
And we'll start off with the hello world.

117
00:05:22,090 --> 00:05:24,090
So we're gonna type in print.

118
00:05:24,090 --> 00:05:27,840
Which is a command to actually type or
to display something on the screen.

119
00:05:27,840 --> 00:05:30,730
And you notice as I'm typing
IntelliJ's actually coming up and

120
00:05:30,730 --> 00:05:31,550
giving us some options.

121
00:05:31,550 --> 00:05:33,580
So if I go back and
start to just type the letter p,

122
00:05:33,580 --> 00:05:35,110
we've got quite a few options there.

123
00:05:35,110 --> 00:05:38,440
And if I start typing,
the more I type the more,

124
00:05:38,440 --> 00:05:40,360
sort of filtered the list
of options come up.

125
00:05:40,360 --> 00:05:42,310
So eventually I've got
the exact command I wanna type,

126
00:05:42,310 --> 00:05:43,680
in this case it's gonna be print.

127
00:05:43,680 --> 00:05:45,940
So IntelliJ does do a lot of this work for

128
00:05:45,940 --> 00:05:48,410
you in terms of trying to figure
out what you're trying to do.

129
00:05:48,410 --> 00:05:50,400
And you don't actually have
to type things in full.

130
00:05:50,400 --> 00:05:53,210
If you're happy that that's the correct
option, you can just press Enter.

131
00:05:53,210 --> 00:05:54,930
And it actually fills in,
does the rest for you.

132
00:05:54,930 --> 00:05:57,470
The other thing is, you might be looking
at those green little messages appearing

133
00:05:57,470 --> 00:05:59,790
down the bottom of the screen,
you're wondering what they are.

134
00:05:59,790 --> 00:06:01,780
I've actually setup a special plugin for

135
00:06:01,780 --> 00:06:04,510
IntelJ to show you
the keystrokes that I'm trying.

136
00:06:04,510 --> 00:06:07,520
So you won't be seeing that when you're
actually this on your computer but

137
00:06:07,520 --> 00:06:10,330
it's there to help you out in case
you run another operating system and

138
00:06:10,330 --> 00:06:12,850
you wanna know what keystrokes
I'm actually pressing.

139
00:06:12,850 --> 00:06:15,150
So moving forward,
I'm going to type in Hello World.

140
00:06:15,150 --> 00:06:19,530
And to print we use single quote,
we just type hello world,

141
00:06:19,530 --> 00:06:22,010
like so, and we're ready to go.

142
00:06:22,010 --> 00:06:22,890
That's literally,

143
00:06:22,890 --> 00:06:26,030
that's probably the easiest Python
program you'll ever actually write.

144
00:06:26,030 --> 00:06:28,080
So you've got a couple
of options here now.

145
00:06:28,080 --> 00:06:30,870
To run it, we can actually
come up here and click on Run.

146
00:06:30,870 --> 00:06:32,910
Go to the Run menu and select Run.

147
00:06:32,910 --> 00:06:35,960
You can also here,
you can actually right-click,

148
00:06:35,960 --> 00:06:38,430
and we can actually click
on Run there as well.

149
00:06:38,430 --> 00:06:41,370
So it's really your personal preference
as to which way you wanna do it, so

150
00:06:41,370 --> 00:06:42,320
I'm gonna click on Run.

151
00:06:42,320 --> 00:06:45,880
And we notice that unsurprisingly,
little more space here.

152
00:06:45,880 --> 00:06:47,490
All our words are actually
shown on the screen.

153
00:06:47,490 --> 00:06:51,110
Now the other thing I wanna point out is
that you can actually choose where you get

154
00:06:51,110 --> 00:06:53,810
this little window,
this little Run window to appear.

155
00:06:53,810 --> 00:06:56,670
You may want the Run window for example
to appear down here, down the bottom,

156
00:06:56,670 --> 00:06:57,680
instead of to the right.

157
00:06:57,680 --> 00:07:00,630
I personally I prefer it to the right but
it is entirely up to you.

158
00:07:00,630 --> 00:07:03,690
And if you wanted to change locations you
could come over here to this little cog,

159
00:07:03,690 --> 00:07:06,110
and you can click on that and
you can actually move two,

160
00:07:06,110 --> 00:07:07,480
and choose the location.

161
00:07:07,480 --> 00:07:11,040
So I've currently got it selected to
the right, which is why right isn't a menu

162
00:07:11,040 --> 00:07:14,610
option, but if I select bottom,
I get the little run menu down the bottom.

163
00:07:14,610 --> 00:07:16,790
So it's a personal preference as
to which way you wanna go there.

164
00:07:16,790 --> 00:07:19,420
And if you wanna close the window,
you can actually press X as well and

165
00:07:19,420 --> 00:07:21,000
that actually closes the window down.

166
00:07:21,000 --> 00:07:25,150
And we'll be going through some of the
other various features of IntelliJ as and

167
00:07:25,150 --> 00:07:25,900
when needed.

168
00:07:25,900 --> 00:07:29,110
But probably the important one was
the Run menu that I actually showed you.

169
00:07:29,110 --> 00:07:32,590
When in doubt, there's lots of shortcuts
that you can learn in IntelliJ.

170
00:07:32,590 --> 00:07:36,530
And you can come up to the various menus
and when you click them you get various

171
00:07:36,530 --> 00:07:39,680
options as to the shortcuts and
what the actual commands do.

172
00:07:39,680 --> 00:07:42,520
And you'll be finding that there's
lots of different shortcuts that

173
00:07:42,520 --> 00:07:45,410
are built into IntelliJ really to
make your life easier as a developer,

174
00:07:45,410 --> 00:07:48,320
and I'll try and show you some of
those as we go through the course.

175
00:07:48,320 --> 00:07:50,930
Some of the shortcuts for
example with the project menu.

176
00:07:50,930 --> 00:07:51,920
I can hold down command and

177
00:07:51,920 --> 00:07:56,280
press 1 and you notice down in the bottom
it says Alt+1 for Windows or Linux.

178
00:07:56,280 --> 00:07:58,170
Press it again and
it actually shuts it down.

179
00:07:58,170 --> 00:07:59,560
So I haven't got that window there now.

180
00:07:59,560 --> 00:08:00,960
I can press it again to bring it back.

181
00:08:00,960 --> 00:08:02,890
And you can do the same for
a lot of the different windows.

182
00:08:02,890 --> 00:08:06,260
Tools > indows, these various windows, we
noticed before when we were running we had

183
00:08:06,260 --> 00:08:08,930
command four, that's not activated
now cuz it's not running.

184
00:08:08,930 --> 00:08:12,480
But that's how you open a window or
you can close a window.

185
00:08:12,480 --> 00:08:13,480
Anyway, getting back to the code.

186
00:08:13,480 --> 00:08:17,250
Now although this is really probably one
of the simplest programs you can actually

187
00:08:17,250 --> 00:08:20,520
write, there are actually a few
important basics to understand here.

188
00:08:20,520 --> 00:08:23,520
So firstly,
we've used the Python function for print.

189
00:08:23,520 --> 00:08:28,860
So Python, like many other programming
languages, has got many mathematical

190
00:08:28,860 --> 00:08:32,419
functions, like round, to round the number
of digits after the decimal point,

191
00:08:32,419 --> 00:08:35,789
char and ord, to convert characters
to the numerical representation,

192
00:08:35,789 --> 00:08:38,390
and vice versa and
many more that are built in.

193
00:08:38,390 --> 00:08:41,740
But you can also actually define your
own functions as you'll see later in

194
00:08:41,740 --> 00:08:42,679
the course as well.

195
00:08:42,679 --> 00:08:45,170
So to tell the print function
what you'd like printed,

196
00:08:45,170 --> 00:08:49,220
you provide a value in parentheses as you
saw there, as you saw me put Hello, World!

197
00:08:49,220 --> 00:08:50,460
in parentheses.

198
00:08:50,460 --> 00:08:54,540
Because we're using a string, we actually
have to put a single quote to the left and

199
00:08:54,540 --> 00:08:57,840
to the right of the string to tell
Python that this was a string.

200
00:08:57,840 --> 00:09:01,900
But we can also put in numerical
numbers if we want it to actually

201
00:09:01,900 --> 00:09:03,610
be computed by Python.

202
00:09:03,610 --> 00:09:09,850
For example, I can type in print 1 + 2 and
do a couple here.

203
00:09:09,850 --> 00:09:12,060
Print 7 * 6.

204
00:09:14,080 --> 00:09:16,090
We can do a print without
any parameters whatsoever,

205
00:09:16,090 --> 00:09:18,090
and which won't print anything.

206
00:09:18,090 --> 00:09:19,840
And we could actually print the end.

207
00:09:19,840 --> 00:09:22,140
And if we actually run this now.

208
00:09:22,140 --> 00:09:23,430
Again, I can right click
that I wanna run it.

209
00:09:23,430 --> 00:09:26,910
Down at the bottom you can see
hello world, for the first line,

210
00:09:26,910 --> 00:09:29,130
which we saw in the previous
time we ran the app.

211
00:09:29,130 --> 00:09:32,350
Print 1 + 2,
now to three there as you can see.

212
00:09:32,350 --> 00:09:34,610
Print 7 * 6, which is 42.

213
00:09:34,610 --> 00:09:38,560
And you notice print in
parenthesis without any primers,

214
00:09:38,560 --> 00:09:40,570
in other words, with nothing in there.

215
00:09:40,570 --> 00:09:43,710
Print in the blank line and
of course using the string again, the end,

216
00:09:43,710 --> 00:09:45,620
and surprisingly printed the end.

217
00:09:45,620 --> 00:09:49,110
So in regards to strings, strings
can be enclosed in either double or

218
00:09:49,110 --> 00:09:50,170
single quotes.

219
00:09:50,170 --> 00:09:53,310
So you saw that in the first example,
there had a single quote.

220
00:09:53,310 --> 00:09:55,420
But down here at the end
I used double quotes.

221
00:09:55,420 --> 00:09:57,490
So, Python doesn't mind which one you use.

222
00:09:57,490 --> 00:10:01,430
You can use either, but if you want to
include a single quote in a string you

223
00:10:01,430 --> 00:10:04,240
normally want it to surround
that in double quotes.

224
00:10:04,240 --> 00:10:11,220
What I mean by that is I can put something
like Python strings are easy to use.

225
00:10:12,920 --> 00:10:15,680
And that works okay because we've
got double quotes surrounding it and

226
00:10:15,680 --> 00:10:17,070
we can also do something like this.

227
00:10:17,070 --> 00:10:20,970
If we wanna use a double quote,

228
00:10:20,970 --> 00:10:26,670
then we can even include quotes and
strings.

229
00:10:26,670 --> 00:10:29,430
So basically if you wanna
use a particular a single or

230
00:10:29,430 --> 00:10:33,180
double quote, use the opposite quote
to actually create the string.

231
00:10:33,180 --> 00:10:35,710
To unlock other languages like Perl for
example,

232
00:10:35,710 --> 00:10:39,150
there's no difference between
using single or double quotes.

233
00:10:39,150 --> 00:10:41,620
So Python doesn't make any
distinction between those.

234
00:10:41,620 --> 00:10:42,130
That said,

235
00:10:42,130 --> 00:10:45,850
if you start a string with one type, then
you must finish it with the same type.

236
00:10:45,850 --> 00:10:48,160
So if you need to include
a single quote in a string,

237
00:10:48,160 --> 00:10:50,740
then use double quotes to enclose
a string like I mentioned.

238
00:10:50,740 --> 00:10:53,910
Similarly, if you wanna
include double quotes,

239
00:10:53,910 --> 00:10:55,890
then close the string in single quotes.

240
00:10:55,890 --> 00:10:58,770
The other thing you can also do
is you can concatenate strings.

241
00:10:58,770 --> 00:10:59,330
So in other words,

242
00:10:59,330 --> 00:11:03,390
you can make a string longer by
actually putting two strings together.

243
00:11:03,390 --> 00:11:10,580
So the way we can do that is we
can type print("hello" + World.

244
00:11:10,580 --> 00:11:14,050
So, that's actually a distinction
to this previous line here,

245
00:11:14,050 --> 00:11:15,560
where you've got one big stream.

246
00:11:15,560 --> 00:11:19,060
We've actually created two independent
streams, that one and that one.

247
00:11:19,060 --> 00:11:22,710
And the plus actually adds them both
together to form a master stream.

248
00:11:22,710 --> 00:11:24,900
So, that basically joins
the two words together.

249
00:11:24,900 --> 00:11:26,170
So I've actually got to run this now.

250
00:11:27,260 --> 00:11:29,390
Down the bottom of your
file that says hello world.

251
00:11:29,390 --> 00:11:32,300
And that's because it's actually joined
those two because we've used that plus to

252
00:11:32,300 --> 00:11:34,190
say add those two strings together.

253
00:11:34,190 --> 00:11:37,760
I'm just gonna move this run
window to the right hand corner,

254
00:11:37,760 --> 00:11:39,310
to the right hand side of the screen.

255
00:11:39,310 --> 00:11:41,300
Okay, so let's put in hello world.

256
00:11:41,300 --> 00:11:45,160
Hello plus world example that I showed you
above isn't really very impressive, but

257
00:11:45,160 --> 00:11:47,910
what we can also do is store
the strings in variables and

258
00:11:47,910 --> 00:11:48,960
it makes more sense to do that.

259
00:11:48,960 --> 00:11:52,220
So we can do something like this,
we can type greeting.

260
00:11:52,220 --> 00:11:54,420
Equals hello.

261
00:11:54,420 --> 00:11:59,090
Name equals Bruce.

262
00:11:59,090 --> 00:12:00,650
Print.

263
00:12:00,650 --> 00:12:03,320
Greeting plus name, and so, Enter.

264
00:12:03,320 --> 00:12:08,240
And the other thing is we can also
put a space between hello and Bruce,

265
00:12:08,240 --> 00:12:09,010
we could type print.

266
00:12:10,330 --> 00:12:14,310
greeting +, one space in there, + 9.

267
00:12:14,310 --> 00:12:16,600
I'm going to introduce
you now also to a comet.

268
00:12:16,600 --> 00:12:20,440
Now a comet is where you've got
something you want to add to

269
00:12:20,440 --> 00:12:22,350
sort of remind yourself perhaps, or

270
00:12:22,350 --> 00:12:25,310
give you some information about a
particular bit of code that you've added.

271
00:12:25,310 --> 00:12:29,310
If you put a hash, and type in something
like, some instructions for yourself.

272
00:12:34,630 --> 00:12:36,240
It then enables you to type that in there.

273
00:12:36,240 --> 00:12:40,290
Anything after the hash, that entire
line is ignored by the computer.

274
00:12:40,290 --> 00:12:41,650
So it's there entirely for

275
00:12:41,650 --> 00:12:45,420
your benefit to help you to help you to
understand a particular program better.

276
00:12:45,420 --> 00:12:48,470
It's always a good idea when you are
programming to put a comments in there and

277
00:12:48,470 --> 00:12:49,030
that's what this is.

278
00:12:49,030 --> 00:12:50,150
This is called a comment.

279
00:12:50,150 --> 00:12:53,200
Put as much information as you can in
there to remind yourself of why I've done

280
00:12:53,200 --> 00:12:55,760
something in a particular way,
to help you understand.

281
00:12:55,760 --> 00:12:59,050
And you'll find that when your reading
other people's program source code

282
00:12:59,050 --> 00:13:01,800
that actually happens as well,
that they comment it.

283
00:13:01,800 --> 00:13:04,650
You can read their comments and
actually understand it a bit better.

284
00:13:04,650 --> 00:13:06,140
Just to confirm, we're gonna run this.

285
00:13:07,630 --> 00:13:09,940
And you can see it's got
HelloBruce the first time.

286
00:13:09,940 --> 00:13:12,180
That's because we didn't have
a space on that line there.

287
00:13:12,180 --> 00:13:14,470
We had hello and Bruce without a space.

288
00:13:14,470 --> 00:13:18,020
And in the second line, we actually added
a space between the words hello and

289
00:13:18,020 --> 00:13:20,770
Bruce and
it actually correctly showed the space.

290
00:13:20,770 --> 00:13:23,630
All right, I'm gonna end this video here
now, because it's getting a little long.

291
00:13:23,630 --> 00:13:27,050
But when I come back we're gonna continue
on with our introduction to Python.

292
00:13:27,050 --> 00:13:30,000
And we're gonna actually have a look
at the input function which allows you

293
00:13:30,000 --> 00:13:31,470
read an unknown from a keyboard.

294
00:13:31,470 --> 00:13:32,710
So, I'll see you in that next video.

