Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,270 --> 00:00:04,200
To begin open up your browser and head over to this URL.
2
00:00:04,230 --> 00:00:09,360
Now, if you didn't want to type all of that out and make some typos and errors and not get to the right
3
00:00:09,360 --> 00:00:13,710
place, then simply just head over to the course resources and click on the link there.
4
00:00:13,740 --> 00:00:15,870
It'll take you directly to this page.
5
00:00:16,730 --> 00:00:22,370
Now, once you've clicked on the link that takes you to the starting replit, you should see something
6
00:00:22,370 --> 00:00:23,800
that looks like this.
7
00:00:23,810 --> 00:00:29,210
And the first thing I want you to do is to go ahead and click on the "Fork" button.
8
00:00:29,660 --> 00:00:37,130
What this is going to do is it's going to create a version of that same replit that you'll see me
9
00:00:37,130 --> 00:00:41,480
working through in the videos, but in this case you'll be able to edit it.
10
00:00:41,930 --> 00:00:46,220
So if you want to save the work that you're doing, I recommend signing up to replit.
11
00:00:46,250 --> 00:00:47,360
It's completely free.
12
00:00:47,360 --> 00:00:49,460
You don't need any credit cards or anything.
13
00:00:49,460 --> 00:00:55,580
Once you've created your account on replit, it will take you to the previous page where you can now
14
00:00:55,580 --> 00:00:58,580
actually click the fork repl button.
15
00:00:58,580 --> 00:01:06,020
And what that will do is it will create a copy of what I've created and put it into your account, and
16
00:01:06,020 --> 00:01:11,810
then you'll be able to see a record of all of the code that you've written throughout the course.
17
00:01:12,050 --> 00:01:16,940
In this course you'll be coding along with me on replit and completing a whole bunch of interactive
18
00:01:16,940 --> 00:01:19,820
coding exercises in our replit classroom.
19
00:01:20,450 --> 00:01:28,100
So go ahead, pause the video, sign up to replit and make sure you've forked the starting copy of
20
00:01:28,100 --> 00:01:31,790
Day one printing start and you should be on a screen that looks like this.
21
00:01:33,610 --> 00:01:39,760
And once you're signed in, then you can actually go ahead and edit the name of the replit or add a
22
00:01:39,760 --> 00:01:45,340
brief description and you'll be able to access it later on through the My Repls folder.
23
00:01:45,580 --> 00:01:51,040
Now, once you've done that, then let's go ahead and walk through some of the different parts of replit
24
00:01:51,070 --> 00:01:52,270
that you'll be using.
25
00:01:52,690 --> 00:01:58,360
First, on the left-hand side pane here, you've got some files and you can see the current file that's
26
00:01:58,360 --> 00:02:04,930
open is this Python file here, and you can create new files or you can create new folders and later
27
00:02:04,930 --> 00:02:08,110
on will be using these features to organize our code.
28
00:02:08,470 --> 00:02:14,140
Now the other part of the left hand side pane that's really useful is the Settings tab here, and I
29
00:02:14,140 --> 00:02:17,950
recommend everybody to switch their font size up to large.
30
00:02:18,190 --> 00:02:22,780
This just makes it so much easier to identify mistakes and any typos you make.
31
00:02:22,810 --> 00:02:28,030
Now we're going to leave everything else as it is, and you can click on the settings button to collapse
32
00:02:28,030 --> 00:02:31,960
that pane so that you end up with more space for writing code.
33
00:02:32,230 --> 00:02:36,040
And this area here is where you're going to be doing that.
34
00:02:36,040 --> 00:02:38,470
All of your code is going to go inside here.
35
00:02:38,590 --> 00:02:43,840
And once we're done with writing our code, we'll click run and it will execute.
36
00:02:43,840 --> 00:02:48,820
And the results of our code will come up over on the console in the right here.
37
00:02:49,510 --> 00:02:54,430
And I generally prefer to code using a darker background.
38
00:02:54,430 --> 00:02:58,510
It's slightly easier on my eyes, especially when you're working at night.
39
00:02:59,230 --> 00:03:05,230
So these are some of the most important parts of replit, but the important thing is it allows us to
40
00:03:05,230 --> 00:03:06,910
just get started.
41
00:03:07,000 --> 00:03:12,580
Now remember that the whole reason why we're learning to program is to be able to tell the computer
42
00:03:12,580 --> 00:03:16,660
what it needs to do and for it to follow our commands.
43
00:03:16,750 --> 00:03:22,000
So let's go ahead and tell the computer to do something, and we're going to do that by writing our
44
00:03:22,000 --> 00:03:23,590
first line of code.
45
00:03:23,980 --> 00:03:29,470
So in this case, I'm creating something called a print function, which is just the word "print", all
46
00:03:29,470 --> 00:03:33,160
in lowercase, and then followed by a set of parentheses.
47
00:03:33,280 --> 00:03:40,480
Now inside these parentheses, I'm going to tell it what I want it to print, and hopefully it's going
48
00:03:40,480 --> 00:03:43,240
to output that inside our console.
49
00:03:44,080 --> 00:03:49,480
So I'm going to start off by writing the classic "Hello World" inside here.
50
00:03:49,690 --> 00:03:53,470
And then once you're ready, then go ahead and click Run.
51
00:03:54,130 --> 00:03:59,980
After a few seconds, you should see the computer follow your command, namely printing the words that
52
00:03:59,980 --> 00:04:04,960
you told it to print inside the console or the output area over here.
53
00:04:05,770 --> 00:04:11,800
And once it's done, it indicates that with the little orange arrow and the way that this command works
54
00:04:11,800 --> 00:04:13,020
is super simple.
55
00:04:13,030 --> 00:04:19,959
You have the keyword "print" followed by a set of parentheses, and then inside the parentheses you tell
56
00:04:19,959 --> 00:04:21,700
it what you want it to print.
57
00:04:22,120 --> 00:04:28,390
And once you've inserted that, then when this line of code gets executed by the computer, it'll know
58
00:04:28,390 --> 00:04:33,580
to simply print or output the thing that you've placed in between the parentheses.
59
00:04:35,790 --> 00:04:43,470
But notice here that it's not just the word hello world exclamation mark that I've put inside my parentheses.
60
00:04:43,800 --> 00:04:49,230
I've also added some quotation marks or double quotes around the word.
61
00:04:49,650 --> 00:04:56,970
And the reason why I've done this is so that I can tell the computer that this bit here in between the
62
00:04:56,970 --> 00:04:59,220
double quotes is not code.
63
00:04:59,220 --> 00:05:02,340
It's not like print where it's supposed to do something.
64
00:05:02,340 --> 00:05:06,510
This is just some text that I've made up that I want it to print out.
65
00:05:07,670 --> 00:05:12,620
And these pieces of text in programming lingo is known as strings.
66
00:05:12,770 --> 00:05:16,700
And you can imagine it as almost like a pearl necklace, right?
67
00:05:16,700 --> 00:05:19,550
It's a string of characters.
68
00:05:20,030 --> 00:05:29,300
And what the double quotes do is they basically show the beginning and the end of that string of characters.
69
00:05:30,300 --> 00:05:34,090
So that means you have to be really careful when you're typing.
70
00:05:34,110 --> 00:05:39,240
For example, if I go ahead and I miss out the closing double quote.
71
00:05:39,390 --> 00:05:45,390
Well, now you can see that there's some changes that have happened to our code already, namely that
72
00:05:45,390 --> 00:05:51,720
the last parentheses, instead of being coloured in white like the opening parentheses or how it used
73
00:05:51,720 --> 00:05:54,840
to be, it's now coloured in orange.
74
00:05:54,840 --> 00:05:57,090
And this is a subtle hint to us.
75
00:05:57,180 --> 00:06:03,780
You're going to get really attuned to these subtle hints because they are the clues that will tell you
76
00:06:03,780 --> 00:06:05,760
what might have gone wrong in your code.
77
00:06:05,970 --> 00:06:09,840
If I run this code as it is right now, it's going to break.
78
00:06:09,870 --> 00:06:17,280
It's going to give me a syntax error and it says something that seems like it's completely non English.
79
00:06:17,340 --> 00:06:20,370
So how can we figure out what this means?
80
00:06:21,000 --> 00:06:25,710
Now the thing I want you to know is that all programmers make mistakes.
81
00:06:25,710 --> 00:06:33,870
We all make lots of errors, like forgetting to add the double quotes at the end of the string or forgetting
82
00:06:33,870 --> 00:06:37,170
to add a closing parentheses.
83
00:06:37,290 --> 00:06:40,470
These things are just common errors because we're human.
84
00:06:40,800 --> 00:06:47,400
But the thing that differentiates great programmers is we're really good at figuring out what the problem
85
00:06:47,400 --> 00:06:48,780
is and how to fix it.
86
00:06:48,960 --> 00:06:53,430
So you can imagine that coding is just a whole bunch of problems that you have to solve.
87
00:06:53,610 --> 00:07:00,540
And in this case, when we get some sort of red text on the right and our code is not doing what we
88
00:07:00,540 --> 00:07:07,110
expect it to do, then all we have to do is take this entire error message where it says something,
89
00:07:07,110 --> 00:07:12,420
something error, and this is some sort of message that we're supposed to understand and we're simply
90
00:07:12,420 --> 00:07:14,280
going to drop it into Google.
91
00:07:14,400 --> 00:07:19,740
And usually the first link you come across will be from a website called StackOverflow.com.
92
00:07:19,860 --> 00:07:25,800
And this is basically the Q&A website that all developers will go to whenever something is wrong with
93
00:07:25,800 --> 00:07:28,620
their code or when they can't figure out how to do something.
94
00:07:29,910 --> 00:07:35,370
So if we click on this link, you can see that somebody else has also had this error.
95
00:07:35,730 --> 00:07:42,510
And some kind souls have told us that the solution might be the fact that you're missing a double quote
96
00:07:42,510 --> 00:07:44,480
before the end of the line.
97
00:07:44,490 --> 00:07:50,610
So if we take a look back at our code, the code that generated this error looks like this.
98
00:07:50,700 --> 00:07:55,560
And indeed, we are missing a double quote at the end of our string.
99
00:07:57,150 --> 00:08:02,430
As you're learning to code, as you're going through your 100 days, I want you to become more and more
100
00:08:02,430 --> 00:08:05,910
attuned to the color of your code.
101
00:08:06,000 --> 00:08:12,240
Because one of the most helpful things that code editors such as this do for us is something called
102
00:08:12,240 --> 00:08:13,980
syntax highlighting.
103
00:08:14,340 --> 00:08:20,970
For example, when I was missing that double quote, it highlighted this entire thing in this orange
104
00:08:20,970 --> 00:08:21,550
color.
105
00:08:21,660 --> 00:08:27,430
And that is basically it telling us it seems like this whole thing is some text.
106
00:08:27,450 --> 00:08:33,900
It thinks that all of this is a string and that we're missing a closing parenthesis.
107
00:08:35,039 --> 00:08:39,720
So if you notice this and you're like, Wait, actually that's not right.
108
00:08:39,720 --> 00:08:43,650
This part should be orange because this is what I want to be printed.
109
00:08:43,650 --> 00:08:48,420
But this part should match the color of the open brace, which is white.
110
00:08:48,420 --> 00:08:50,520
So there must be something wrong here.
111
00:08:50,550 --> 00:08:57,450
And indeed, if you have a look at the error message, it actually has a little carat sign right here
112
00:08:57,450 --> 00:09:04,500
showing you that there's something that's probably not right here and it might jog your memory that,
113
00:09:04,500 --> 00:09:07,980
oh, yeah, I've forgotten a closing double quote.
114
00:09:08,820 --> 00:09:12,420
And now when we run our code, you'll see that it's good as new.
115
00:09:12,600 --> 00:09:18,030
So now it's your turn to try it out in a code challenge.
116
00:09:18,150 --> 00:09:19,650
Head over to the next lesson.
117
00:09:19,650 --> 00:09:25,410
Sign up to our classroom and then I'll guide you through getting started on your first coding challenge.
118
00:09:25,410 --> 00:09:27,300
So all of that and more.
119
00:09:27,300 --> 00:09:28,710
I'll see you on the next lesson.
13048
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.