WEBVTT 1 00:00:02.210 --> 00:00:05.640 So now that we've actually installed and configured Python and set up IntelliJ, 2 00:00:05.640 --> 00:00:08.878 it's time to start talking about and using Python. 3 00:00:08.878 --> 00:00:11.810 First I wanna give you a little bit of an introduction of Python. 4 00:00:11.810 --> 00:00:14.940 Now it's actually an object orientated interpreted language. 5 00:00:14.940 --> 00:00:17.930 And really it's quite easy to use in terms of other languages. 6 00:00:17.930 --> 00:00:22.788 And also runs on a lot of, many operating systems, including Mac, Windows, 7 00:00:22.788 --> 00:00:25.650 Linux, and quite a few other ones as well. 8 00:00:25.650 --> 00:00:28.867 It's interesting, it's actually named after the cult comedy show 9 00:00:28.867 --> 00:00:31.877 Monty Python's Flying Circus, but [LAUGH] not after the snake. 10 00:00:31.877 --> 00:00:34.882 And you'll find actually various references to Monty Python's sketches in 11 00:00:34.882 --> 00:00:36.270 the official documentation. 12 00:00:36.270 --> 00:00:39.260 The good thing about Python is that it supports a lot of basic data types, 13 00:00:39.260 --> 00:00:40.920 such as numbers and strings. 14 00:00:40.920 --> 00:00:43.850 But also, it supports more complex types, like lists and 15 00:00:43.850 --> 00:00:46.720 dictionaries, that can greatly simplify data processing. 16 00:00:46.720 --> 00:00:48.230 And you'll find out more about that, and 17 00:00:48.230 --> 00:00:50.290 about those data types as you move through the course. 18 00:00:50.290 --> 00:00:53.680 As I mentioned it's object-orientated, so it does support that fully and 19 00:00:53.680 --> 00:00:58.080 allows multiple inheritance, which may be nothing to you at this point in time, but 20 00:00:58.080 --> 00:00:59.310 believe me, it's a good feature, and 21 00:00:59.310 --> 00:01:01.410 you'll be learning about that through the course as well. 22 00:01:01.410 --> 00:01:04.080 The other thing is that the data in Python is strongly typed, so 23 00:01:04.080 --> 00:01:07.950 what I mean by that is for example, if you attempt to add a number. 24 00:01:07.950 --> 00:01:11.940 And a string, you'll actually get an error, but it's also dynamically topped, 25 00:01:11.940 --> 00:01:14.870 so you're free from worrying about variable declarations, 26 00:01:14.870 --> 00:01:18.280 and again I'll be explaining that fully as we go through the course. 27 00:01:18.280 --> 00:01:21.730 Now despite the fact that it's quite easy to use, it's also very powerful. 28 00:01:21.730 --> 00:01:25.260 Interestingly enough, it's one of the three official languages used to Google. 29 00:01:25.260 --> 00:01:28.910 Now the creator of Python, Guido van Rossum, hope I got the pronunciation 30 00:01:28.910 --> 00:01:31.530 correct, he actually worked for Google for over seven years and 31 00:01:31.530 --> 00:01:35.040 he was actually allowed to spend half his time developing Python while he was there. 32 00:01:35.040 --> 00:01:38.120 Now one important consideration before we get into the code, and 33 00:01:38.120 --> 00:01:42.340 I promise you we are getting into the code is that the Python team decided to break 34 00:01:42.340 --> 00:01:44.650 backwards compatibility when they created Python 3. 35 00:01:44.650 --> 00:01:47.240 So while it's very similar to Python 2, and 36 00:01:47.240 --> 00:01:51.270 a lot of programs will work in Python 3, there's no longer any guarantee 37 00:01:51.270 --> 00:01:54.900 that Python 2 programs will actually work with the Python 3 interpreter. 38 00:01:54.900 --> 00:01:57.320 And the other thing to know is that there's no 39 00:01:57.320 --> 00:01:59.080 further development happening with Python 2. 40 00:01:59.080 --> 00:02:02.790 So in other words, version 2.7 of Python is the final version. 41 00:02:02.790 --> 00:02:06.760 But with that said, they're gonna continue to support it until at least 2020. 42 00:02:06.760 --> 00:02:10.690 But, it's really for that reason that we chose Python 3 as the way forward. 43 00:02:10.690 --> 00:02:14.520 And a lot of the code is going to work okay for python 2, and many systems 44 00:02:14.520 --> 00:02:18.380 are running it, but there are differences as you'll find in version 2 and version 3. 45 00:02:18.380 --> 00:02:22.120 So as they come up, we'll actually talk about those differences in this course, so 46 00:02:22.120 --> 00:02:25.200 you can come away with a good understanding if you are in the situation 47 00:02:25.200 --> 00:02:29.080 of having to get to the tricky part of two code working after completing this course. 48 00:02:29.080 --> 00:02:31.020 Anyway enough with the introductions. 49 00:02:31.020 --> 00:02:33.150 Let's get into actually creating some code. 50 00:02:33.150 --> 00:02:34.558 So have your InteliJ open. 51 00:02:34.558 --> 00:02:36.230 So we're gonna create a new project now, so 52 00:02:36.230 --> 00:02:37.880 we can start playing around with Python. 53 00:02:37.880 --> 00:02:40.540 And to do that I'm gonna click on Create New Project. 54 00:02:40.540 --> 00:02:44.880 And if you recall in the previous video I actually configured the project SDK. 55 00:02:44.880 --> 00:02:46.530 So that we were able to start using Python. 56 00:02:46.530 --> 00:02:47.830 So, that's configured. 57 00:02:47.830 --> 00:02:51.220 So make sure you're selecting Python as the type we're going to be using. 58 00:02:51.220 --> 00:02:52.190 The project type. 59 00:02:52.190 --> 00:02:53.310 Click on Next. 60 00:02:53.310 --> 00:02:54.650 I'm not gonna click on any of those options. 61 00:02:54.650 --> 00:02:56.250 I'm gonna leave them as the defaults. 62 00:02:56.250 --> 00:02:57.610 Click on Next. 63 00:02:57.610 --> 00:02:59.980 And next I need to know the folder where I'm going to be putting my files. 64 00:02:59.980 --> 00:03:03.930 And what I'm going to do is create a new folder structure to put all my 65 00:03:03.930 --> 00:03:04.440 Python code. 66 00:03:04.440 --> 00:03:06.330 I'm gonna click on these three little buttons here. 67 00:03:06.330 --> 00:03:09.550 And I'm gonna click on a folder that I've got from my various courses and 68 00:03:09.550 --> 00:03:12.930 I'm gonna click on PythonPrograms. 69 00:03:12.930 --> 00:03:16.770 So, that's my new folder that I'm going to be creating all my projects in. 70 00:03:16.770 --> 00:03:19.910 And each time I create another Python program, 71 00:03:19.910 --> 00:03:21.740 I'm gonna put it in it s own separate folder. 72 00:03:22.890 --> 00:03:25.000 And notice when I did that the first time, 73 00:03:25.000 --> 00:03:27.490 IntelliJ doesn't quite get this right cuz it's assuming, 74 00:03:27.490 --> 00:03:30.430 by the actual path that I created, that that's what I wanna call above. 75 00:03:30.430 --> 00:03:33.608 What I need to do is actually delete that and we'll call it HelloWorld. 76 00:03:33.608 --> 00:03:38.500 It's gonna be our very first program and what I'll need to do is because I'm 77 00:03:38.500 --> 00:03:41.840 actually in here, I need to actually type in HelloWorld there. 78 00:03:41.840 --> 00:03:42.440 So in other words, 79 00:03:42.440 --> 00:03:47.080 the path is Programs/PythonPrograms and the project is HelloWorld. 80 00:03:47.080 --> 00:03:50.410 And what will happen is IntelliJ will create that new folder for 81 00:03:50.410 --> 00:03:51.250 us automatically. 82 00:03:51.250 --> 00:03:54.810 Now, depending on whether you got this button or this option clicked down here, 83 00:03:54.810 --> 00:03:58.140 that may be open or close, these are the options that may come up, but 84 00:03:58.140 --> 00:03:59.790 you can safely ignore all of those. 85 00:03:59.790 --> 00:04:03.480 The main thing is the project location, where you wanna save your files, and 86 00:04:03.480 --> 00:04:04.070 the project name. 87 00:04:04.070 --> 00:04:06.720 Again, this doesn't really matter to this day, but we're gonna go ahead and 88 00:04:06.720 --> 00:04:07.430 call it HelloWorld. 89 00:04:07.430 --> 00:04:09.370 So we're gonna click on Finish. 90 00:04:09.370 --> 00:04:12.220 And IntelliJ will come and say, do you want me to create that folder? 91 00:04:12.220 --> 00:04:13.980 Well, that's yes, we do want you to do that. 92 00:04:13.980 --> 00:04:15.420 So I'm gonna click OK. 93 00:04:15.420 --> 00:04:17.450 And actually create it for us and IntelliJ will open up. 94 00:04:17.450 --> 00:04:22.170 And what I'm gonna do is go into presentation mode, so 95 00:04:22.170 --> 00:04:24.360 it's easy for you to see what I'm typing. 96 00:04:24.360 --> 00:04:28.000 And the other thing to do which, note that IntelliJ has selected that anyway, but 97 00:04:28.000 --> 00:04:30.040 make sure that project view is selected. 98 00:04:30.040 --> 00:04:32.970 That's the easiest one to never get through your various false trackers that 99 00:04:32.970 --> 00:04:34.550 you'll need to do doing this course. 100 00:04:34.550 --> 00:04:37.060 So I'm gonna click on that and I'm gonna open this up. 101 00:04:37.060 --> 00:04:38.150 And we're actually ready to go. 102 00:04:38.150 --> 00:04:42.082 So what we're gonna do first, we're gonna go and create a new python file. 103 00:04:42.082 --> 00:04:46.760 So we've created a project, and a project can contain a number of different files. 104 00:04:46.760 --> 00:04:50.120 We're gonna create a python file, so we can actually type some code in. 105 00:04:50.120 --> 00:04:52.190 So to do that, we're gonna click on, go to the File menu. 106 00:04:53.500 --> 00:04:55.690 Click on New, and then select Python File. 107 00:04:56.730 --> 00:04:59.680 And notice that the kind is automatically selected, python file. 108 00:04:59.680 --> 00:05:02.857 We're gonna type in HelloWorld. 109 00:05:02.857 --> 00:05:04.905 And we're gonna go press Enter or I'm gonna click OK. 110 00:05:04.905 --> 00:05:06.730 >> And we've now got some code on the screen. 111 00:05:06.730 --> 00:05:10.190 So you notice that in line 1, IntelliJ has added that automatically. 112 00:05:10.190 --> 00:05:13.220 It's added the username for the particular machine that you're on. 113 00:05:13.220 --> 00:05:14.390 So you can safely ignore that. 114 00:05:14.390 --> 00:05:16.070 That'll be added automatically. 115 00:05:16.070 --> 00:05:17.270 So let's actually put some code in. 116 00:05:17.270 --> 00:05:18.980 And we'll start off with the hello world. 117 00:05:18.980 --> 00:05:20.980 So we're gonna type in print. 118 00:05:20.980 --> 00:05:24.730 Which is a command to actually type or to display something on the screen. 119 00:05:24.730 --> 00:05:27.620 And you notice as I'm typing IntelliJ's actually coming up and 120 00:05:27.620 --> 00:05:28.440 giving us some options. 121 00:05:28.440 --> 00:05:30.470 So if I go back and start to just type the letter p, 122 00:05:30.470 --> 00:05:32.000 we've got quite a few options there. 123 00:05:32.000 --> 00:05:35.330 And if I start typing, the more I type the more, 124 00:05:35.330 --> 00:05:37.250 sort of filtered the list of options come up. 125 00:05:37.250 --> 00:05:39.200 So eventually I've got the exact command I wanna type, 126 00:05:39.200 --> 00:05:40.572 in this case it's gonna be print. 127 00:05:40.572 --> 00:05:42.830 So IntelliJ does do a lot of this work for 128 00:05:42.830 --> 00:05:45.300 you in terms of trying to figure out what you're trying to do. 129 00:05:45.300 --> 00:05:47.290 And you don't actually have to type things in full. 130 00:05:47.290 --> 00:05:50.100 If you're happy that that's the correct option, you can just press Enter. 131 00:05:50.100 --> 00:05:51.827 And it actually fills in, does the rest for you. 132 00:05:51.827 --> 00:05:54.365 The other thing is, you might be looking at those green little messages appearing 133 00:05:54.365 --> 00:05:56.680 down the bottom of the screen, you're wondering what they are. 134 00:05:56.680 --> 00:05:58.675 I've actually setup a special plugin for 135 00:05:58.675 --> 00:06:01.400 IntelJ to show you the keystrokes that I'm trying. 136 00:06:01.400 --> 00:06:04.410 So you won't be seeing that when you're actually this on your computer but 137 00:06:04.410 --> 00:06:07.228 it's there to help you out in case you run another operating system and 138 00:06:07.228 --> 00:06:09.740 you wanna know what keystrokes I'm actually pressing. 139 00:06:09.740 --> 00:06:12.043 So moving forward, I'm going to type in Hello World. 140 00:06:12.043 --> 00:06:16.429 And to print we use single quote, we just type hello world, 141 00:06:16.429 --> 00:06:18.900 like so, and we're ready to go. 142 00:06:18.900 --> 00:06:19.782 That's literally, 143 00:06:19.782 --> 00:06:22.920 that's probably the easiest Python program you'll ever actually write. 144 00:06:22.920 --> 00:06:24.970 So you've got a couple of options here now. 145 00:06:24.970 --> 00:06:27.760 To run it, we can actually come up here and click on Run. 146 00:06:27.760 --> 00:06:29.800 Go to the Run menu and select Run. 147 00:06:29.800 --> 00:06:32.850 You can also here, you can actually right-click, 148 00:06:32.850 --> 00:06:35.320 and we can actually click on Run there as well. 149 00:06:35.320 --> 00:06:38.260 So it's really your personal preference as to which way you wanna do it, so 150 00:06:38.260 --> 00:06:39.210 I'm gonna click on Run. 151 00:06:39.210 --> 00:06:42.770 And we notice that unsurprisingly, little more space here. 152 00:06:42.770 --> 00:06:44.380 All our words are actually shown on the screen. 153 00:06:44.380 --> 00:06:48.000 Now the other thing I wanna point out is that you can actually choose where you get 154 00:06:48.000 --> 00:06:50.706 this little window, this little Run window to appear. 155 00:06:50.706 --> 00:06:53.560 You may want the Run window for example to appear down here, down the bottom, 156 00:06:53.560 --> 00:06:54.575 instead of to the right. 157 00:06:54.575 --> 00:06:57.520 I personally I prefer it to the right but it is entirely up to you. 158 00:06:57.520 --> 00:07:00.580 And if you wanted to change locations you could come over here to this little cog, 159 00:07:00.580 --> 00:07:03.000 and you can click on that and you can actually move two, 160 00:07:03.000 --> 00:07:04.370 and choose the location. 161 00:07:04.370 --> 00:07:07.930 So I've currently got it selected to the right, which is why right isn't a menu 162 00:07:07.930 --> 00:07:11.500 option, but if I select bottom, I get the little run menu down the bottom. 163 00:07:11.500 --> 00:07:13.680 So it's a personal preference as to which way you wanna go there. 164 00:07:13.680 --> 00:07:16.310 And if you wanna close the window, you can actually press X as well and 165 00:07:16.310 --> 00:07:17.890 that actually closes the window down. 166 00:07:17.890 --> 00:07:22.040 And we'll be going through some of the other various features of IntelliJ as and 167 00:07:22.040 --> 00:07:22.790 when needed. 168 00:07:22.790 --> 00:07:26.000 But probably the important one was the Run menu that I actually showed you. 169 00:07:26.000 --> 00:07:29.480 When in doubt, there's lots of shortcuts that you can learn in IntelliJ. 170 00:07:29.480 --> 00:07:33.424 And you can come up to the various menus and when you click them you get various 171 00:07:33.424 --> 00:07:36.578 options as to the shortcuts and what the actual commands do. 172 00:07:36.578 --> 00:07:39.417 And you'll be finding that there's lots of different shortcuts that 173 00:07:39.417 --> 00:07:42.303 are built into IntelliJ really to make your life easier as a developer, 174 00:07:42.303 --> 00:07:45.210 and I'll try and show you some of those as we go through the course. 175 00:07:45.210 --> 00:07:47.820 Some of the shortcuts for example with the project menu. 176 00:07:47.820 --> 00:07:48.810 I can hold down command and 177 00:07:48.810 --> 00:07:53.170 press 1 and you notice down in the bottom it says Alt+1 for Windows or Linux. 178 00:07:53.170 --> 00:07:55.060 Press it again and it actually shuts it down. 179 00:07:55.060 --> 00:07:56.450 So I haven't got that window there now. 180 00:07:56.450 --> 00:07:57.850 I can press it again to bring it back. 181 00:07:57.850 --> 00:07:59.780 And you can do the same for a lot of the different windows. 182 00:07:59.780 --> 00:08:03.155 Tools > indows, these various windows, we noticed before when we were running we had 183 00:08:03.155 --> 00:08:05.825 command four, that's not activated now cuz it's not running. 184 00:08:05.825 --> 00:08:09.375 But that's how you open a window or you can close a window. 185 00:08:09.375 --> 00:08:10.375 Anyway, getting back to the code. 186 00:08:10.375 --> 00:08:14.145 Now although this is really probably one of the simplest programs you can actually 187 00:08:14.145 --> 00:08:17.410 write, there are actually a few important basics to understand here. 188 00:08:17.410 --> 00:08:20.410 So firstly, we've used the Python function for print. 189 00:08:20.410 --> 00:08:25.750 So Python, like many other programming languages, has got many mathematical 190 00:08:25.750 --> 00:08:29.310 functions, like round, to round the number of digits after the decimal point, 191 00:08:29.310 --> 00:08:32.680 char and ord, to convert characters to the numerical representation, 192 00:08:32.680 --> 00:08:35.280 and vice versa and many more that are built in. 193 00:08:35.280 --> 00:08:38.630 But you can also actually define your own functions as you'll see later in 194 00:08:38.630 --> 00:08:39.570 the course as well. 195 00:08:39.570 --> 00:08:42.060 So to tell the print function what you'd like printed, 196 00:08:42.060 --> 00:08:46.110 you provide a value in parentheses as you saw there, as you saw me put Hello, World! 197 00:08:46.110 --> 00:08:47.350 in parentheses. 198 00:08:47.350 --> 00:08:51.430 Because we're using a string, we actually have to put a single quote to the left and 199 00:08:51.430 --> 00:08:54.730 to the right of the string to tell Python that this was a string. 200 00:08:54.730 --> 00:08:58.790 But we can also put in numerical numbers if we want it to actually 201 00:08:58.790 --> 00:09:00.500 be computed by Python. 202 00:09:00.500 --> 00:09:06.740 For example, I can type in print 1 + 2 and do a couple here. 203 00:09:06.740 --> 00:09:08.950 Print 7 * 6. 204 00:09:10.970 --> 00:09:12.980 We can do a print without any parameters whatsoever, 205 00:09:12.980 --> 00:09:14.980 and which won't print anything. 206 00:09:14.980 --> 00:09:16.730 And we could actually print the end. 207 00:09:16.730 --> 00:09:19.030 And if we actually run this now. 208 00:09:19.030 --> 00:09:20.320 Again, I can right click that I wanna run it. 209 00:09:20.320 --> 00:09:23.800 Down at the bottom you can see hello world, for the first line, 210 00:09:23.800 --> 00:09:26.020 which we saw in the previous time we ran the app. 211 00:09:26.020 --> 00:09:29.240 Print 1 + 2, now to three there as you can see. 212 00:09:29.240 --> 00:09:31.500 Print 7 * 6, which is 42. 213 00:09:31.500 --> 00:09:35.450 And you notice print in parenthesis without any primers, 214 00:09:35.450 --> 00:09:37.460 in other words, with nothing in there. 215 00:09:37.460 --> 00:09:40.600 Print in the blank line and of course using the string again, the end, 216 00:09:40.600 --> 00:09:42.510 and surprisingly printed the end. 217 00:09:42.510 --> 00:09:46.000 So in regards to strings, strings can be enclosed in either double or 218 00:09:46.000 --> 00:09:47.060 single quotes. 219 00:09:47.060 --> 00:09:50.200 So you saw that in the first example, there had a single quote. 220 00:09:50.200 --> 00:09:52.310 But down here at the end I used double quotes. 221 00:09:52.310 --> 00:09:54.380 So, Python doesn't mind which one you use. 222 00:09:54.380 --> 00:09:58.323 You can use either, but if you want to include a single quote in a string you 223 00:09:58.323 --> 00:10:01.130 normally want it to surround that in double quotes. 224 00:10:01.130 --> 00:10:08.115 What I mean by that is I can put something like Python strings are easy to use. 225 00:10:09.815 --> 00:10:12.575 And that works okay because we've got double quotes surrounding it and 226 00:10:12.575 --> 00:10:13.961 we can also do something like this. 227 00:10:13.961 --> 00:10:17.861 If we wanna use a double quote, 228 00:10:17.861 --> 00:10:23.561 then we can even include quotes and strings. 229 00:10:23.561 --> 00:10:26.322 So basically if you wanna use a particular a single or 230 00:10:26.322 --> 00:10:30.070 double quote, use the opposite quote to actually create the string. 231 00:10:30.070 --> 00:10:32.609 To unlock other languages like Perl for example, 232 00:10:32.609 --> 00:10:36.040 there's no difference between using single or double quotes. 233 00:10:36.040 --> 00:10:38.510 So Python doesn't make any distinction between those. 234 00:10:38.510 --> 00:10:39.020 That said, 235 00:10:39.020 --> 00:10:42.740 if you start a string with one type, then you must finish it with the same type. 236 00:10:42.740 --> 00:10:45.050 So if you need to include a single quote in a string, 237 00:10:45.050 --> 00:10:47.630 then use double quotes to enclose a string like I mentioned. 238 00:10:47.630 --> 00:10:50.800 Similarly, if you wanna include double quotes, 239 00:10:50.800 --> 00:10:52.780 then close the string in single quotes. 240 00:10:52.780 --> 00:10:55.660 The other thing you can also do is you can concatenate strings. 241 00:10:55.660 --> 00:10:56.220 So in other words, 242 00:10:56.220 --> 00:11:00.280 you can make a string longer by actually putting two strings together. 243 00:11:00.280 --> 00:11:07.470 So the way we can do that is we can type print("hello" + World. 244 00:11:07.470 --> 00:11:10.940 So, that's actually a distinction to this previous line here, 245 00:11:10.940 --> 00:11:12.450 where you've got one big stream. 246 00:11:12.450 --> 00:11:15.950 We've actually created two independent streams, that one and that one. 247 00:11:15.950 --> 00:11:19.600 And the plus actually adds them both together to form a master stream. 248 00:11:19.600 --> 00:11:21.790 So, that basically joins the two words together. 249 00:11:21.790 --> 00:11:23.060 So I've actually got to run this now. 250 00:11:24.150 --> 00:11:26.280 Down the bottom of your file that says hello world. 251 00:11:26.280 --> 00:11:29.190 And that's because it's actually joined those two because we've used that plus to 252 00:11:29.190 --> 00:11:31.088 say add those two strings together. 253 00:11:31.088 --> 00:11:34.650 I'm just gonna move this run window to the right hand corner, 254 00:11:34.650 --> 00:11:36.200 to the right hand side of the screen. 255 00:11:36.200 --> 00:11:38.190 Okay, so let's put in hello world. 256 00:11:38.190 --> 00:11:42.050 Hello plus world example that I showed you above isn't really very impressive, but 257 00:11:42.050 --> 00:11:44.800 what we can also do is store the strings in variables and 258 00:11:44.800 --> 00:11:45.850 it makes more sense to do that. 259 00:11:45.850 --> 00:11:49.113 So we can do something like this, we can type greeting. 260 00:11:49.113 --> 00:11:51.315 Equals hello. 261 00:11:51.315 --> 00:11:55.981 Name equals Bruce. 262 00:11:55.981 --> 00:11:57.540 Print. 263 00:11:57.540 --> 00:12:00.210 Greeting plus name, and so, Enter. 264 00:12:00.210 --> 00:12:05.130 And the other thing is we can also put a space between hello and Bruce, 265 00:12:05.130 --> 00:12:05.900 we could type print. 266 00:12:07.220 --> 00:12:11.208 greeting +, one space in there, + 9. 267 00:12:11.208 --> 00:12:13.490 I'm going to introduce you now also to a comet. 268 00:12:13.490 --> 00:12:17.330 Now a comet is where you've got something you want to add to 269 00:12:17.330 --> 00:12:19.240 sort of remind yourself perhaps, or 270 00:12:19.240 --> 00:12:22.200 give you some information about a particular bit of code that you've added. 271 00:12:22.200 --> 00:12:26.209 If you put a hash, and type in something like, some instructions for yourself. 272 00:12:31.521 --> 00:12:33.130 It then enables you to type that in there. 273 00:12:33.130 --> 00:12:37.180 Anything after the hash, that entire line is ignored by the computer. 274 00:12:37.180 --> 00:12:38.540 So it's there entirely for 275 00:12:38.540 --> 00:12:42.310 your benefit to help you to help you to understand a particular program better. 276 00:12:42.310 --> 00:12:45.360 It's always a good idea when you are programming to put a comments in there and 277 00:12:45.360 --> 00:12:45.920 that's what this is. 278 00:12:45.920 --> 00:12:47.040 This is called a comment. 279 00:12:47.040 --> 00:12:50.090 Put as much information as you can in there to remind yourself of why I've done 280 00:12:50.090 --> 00:12:52.650 something in a particular way, to help you understand. 281 00:12:52.650 --> 00:12:55.940 And you'll find that when your reading other people's program source code 282 00:12:55.940 --> 00:12:58.690 that actually happens as well, that they comment it. 283 00:12:58.690 --> 00:13:01.540 You can read their comments and actually understand it a bit better. 284 00:13:01.540 --> 00:13:03.039 Just to confirm, we're gonna run this. 285 00:13:04.520 --> 00:13:06.830 And you can see it's got HelloBruce the first time. 286 00:13:06.830 --> 00:13:09.070 That's because we didn't have a space on that line there. 287 00:13:09.070 --> 00:13:11.360 We had hello and Bruce without a space. 288 00:13:11.360 --> 00:13:14.910 And in the second line, we actually added a space between the words hello and 289 00:13:14.910 --> 00:13:17.662 Bruce and it actually correctly showed the space. 290 00:13:17.662 --> 00:13:20.520 All right, I'm gonna end this video here now, because it's getting a little long. 291 00:13:20.520 --> 00:13:23.940 But when I come back we're gonna continue on with our introduction to Python. 292 00:13:23.940 --> 00:13:26.890 And we're gonna actually have a look at the input function which allows you 293 00:13:26.890 --> 00:13:28.360 read an unknown from a keyboard. 294 00:13:28.360 --> 00:13:29.600 So, I'll see you in that next video.