1
00:00:00,660 --> 00:00:06,660
Throughout this course, we'll be getting you involved in a lot of these interactive coding exercises.

2
00:00:07,050 --> 00:00:11,820
And the idea is that you're not just sitting here watching me talk that you're actually putting everything,

3
00:00:11,820 --> 00:00:13,350
you're learning into practice.

4
00:00:13,620 --> 00:00:15,600
That way, it actually becomes your own.

5
00:00:15,900 --> 00:00:21,780
Is a great because we can give you instructions and show you what should happen if you write the correct

6
00:00:21,780 --> 00:00:22,170
code.

7
00:00:22,440 --> 00:00:27,630
What it needs to do and you'll be able to write your code as well as see it run in the console.

8
00:00:28,200 --> 00:00:32,850
Once you're done with your code, you'll be able to submit it and see the tests run.

9
00:00:33,540 --> 00:00:39,720
And if you've written the code correctly, then all of the tests will pass if your code isn't doing

10
00:00:39,720 --> 00:00:40,720
what it's supposed to.

11
00:00:41,070 --> 00:00:45,600
Then when you click Submit, you'll get feedback and you'll see what it's meant to do and what your

12
00:00:45,600 --> 00:00:47,070
code is actually doing.

13
00:00:47,070 --> 00:00:50,280
So you'll be able to use that to figure out what's wrong and fix your code.

14
00:00:50,790 --> 00:00:55,620
And it's through a lot of these exercises that you're going to level up and you're going to become a

15
00:00:55,620 --> 00:00:56,340
better coder.

16
00:00:56,940 --> 00:01:02,100
Now, in order for you to get set up on our coding rooms, we're going to have to get you signed up

17
00:01:02,400 --> 00:01:04,260
and registered with our course.

18
00:01:04,770 --> 00:01:10,830
So in order to do this, I want you to first head over to Coding Room WSJ.com and then sign up for a

19
00:01:10,890 --> 00:01:11,970
student account.

20
00:01:12,690 --> 00:01:18,570
Now this is completely free, and all you have to do is just to click, sign up, put in your email

21
00:01:18,570 --> 00:01:23,820
and password, and then you can choose Student for this question.

22
00:01:23,820 --> 00:01:24,510
Who are you?

23
00:01:25,080 --> 00:01:33,360
And then put in your first name and last name and click Finish next in order to get hold of the joining

24
00:01:33,360 --> 00:01:33,660
link.

25
00:01:33,810 --> 00:01:37,800
I want you to go to the course resources for the current lesson on Udemy.

26
00:01:38,070 --> 00:01:43,530
So the lesson is interactive coding, exercise printing, and then I want you to click on the dropdown

27
00:01:43,530 --> 00:01:48,420
list and you should see step one sign up to coding rooms, which you should have already done.

28
00:01:48,810 --> 00:01:51,770
And then step two is Join our coding group.

29
00:01:51,780 --> 00:01:53,280
So I want you to click on that link.

30
00:01:53,790 --> 00:01:59,640
And once you've clicked on that link, then it should automatically enroll you into our 100 days of

31
00:01:59,640 --> 00:02:06,420
code, the complete Python Pro Bootcamp, and you should now be able to see every day's corresponding

32
00:02:06,420 --> 00:02:08,070
interactive coding exercises.

33
00:02:08,460 --> 00:02:14,250
So, for example, on day one, there are four exercises and they are named exactly the same as what

34
00:02:14,250 --> 00:02:15,690
you see in Udemy.

35
00:02:15,720 --> 00:02:21,720
So this is interactive coding exercise one which is printing, debugging, practice, input function

36
00:02:21,720 --> 00:02:26,970
and variables, and you see all the same ones over here that you'll be able to attempt.

37
00:02:28,050 --> 00:02:32,700
Now, the next time when you log in, all you have to do is just go into your courses and you should

38
00:02:32,700 --> 00:02:38,760
see the interactive coding exercises for the 100 days of code and you will be able to continue where

39
00:02:38,760 --> 00:02:39,360
you left off.

40
00:02:40,110 --> 00:02:42,950
Now let's get started with the first exercise.

41
00:02:42,960 --> 00:02:45,090
That's the objective of this lesson.

42
00:02:45,570 --> 00:02:48,290
So we're going to go into day one and it might be collapsed.

43
00:02:48,300 --> 00:02:53,520
If so, just go ahead and expand it and then click on exercise one printing.

44
00:02:54,060 --> 00:02:59,460
And here you see the instructions for what you need to do in order to complete this coding exercise.

45
00:03:00,030 --> 00:03:03,600
Now, I want you to go ahead and click on Open Assignment Workspace.

46
00:03:04,260 --> 00:03:09,390
And here you'll be able to see the instructions on one side of the pain.

47
00:03:09,750 --> 00:03:12,990
You'll be able to have your mind up high, which is where you write your code.

48
00:03:13,260 --> 00:03:16,260
So all the lines below here, you can just type your code out.

49
00:03:16,530 --> 00:03:23,460
And then once you're done writing your code, I want you to test it by running your code.

50
00:03:23,730 --> 00:03:30,600
So hitting this run button and you'll see the result of your code being run in the console down here.

51
00:03:30,900 --> 00:03:35,820
Now, once you think you've completed the coding exercise, according to all the instructions over here,

52
00:03:36,180 --> 00:03:41,700
I want you to go ahead and test your code and you can test your code by simply hitting submit.

53
00:03:42,600 --> 00:03:47,310
Now, don't worry about all of this where it says the submission will count towards your grade for the

54
00:03:47,310 --> 00:03:47,870
assignment.

55
00:03:47,880 --> 00:03:50,160
There are no grazes, no time limits.

56
00:03:50,580 --> 00:03:52,770
Nobody is going to check what you've done.

57
00:03:53,040 --> 00:03:58,800
It's all for the benefit of your learning, so you can submit your code to as many times as you like.

58
00:03:59,400 --> 00:04:04,530
So once you hit submit, it's going to run the automated test that we've set up behind the scenes,

59
00:04:04,830 --> 00:04:09,080
and it's going to check to make sure that your code is doing what it's supposed to.

60
00:04:09,930 --> 00:04:17,580
So for example, in this case, my tests have not passed because there's a cross here and note that

61
00:04:17,580 --> 00:04:21,360
sometimes they'll be more than one test so you can scroll down and see the other ones.

62
00:04:21,960 --> 00:04:27,690
And the reason why I didn't pass, as they've shown here is this is my actual output.

63
00:04:27,690 --> 00:04:28,980
This is what my coded.

64
00:04:29,490 --> 00:04:32,640
And this is what the expected output is supposed to be.

65
00:04:32,850 --> 00:04:34,560
And there's a whole bunch of differences.

66
00:04:34,830 --> 00:04:37,050
This does not look like this.

67
00:04:37,590 --> 00:04:39,630
So then we have to go and fix it.

68
00:04:40,020 --> 00:04:43,680
And I've left some feedback in some of the lessons to help you in case you get stuck.

69
00:04:43,950 --> 00:04:46,440
But also, there are hints in some of the instructions.

70
00:04:46,470 --> 00:04:48,840
So just make sure that you read everything.

71
00:04:49,080 --> 00:04:54,630
Now, if you want to, or if you get really, really stuck, you can take a look at the solution.

72
00:04:54,900 --> 00:04:59,550
Now, I don't recommend looking at the solution code unless you actually just checking to make sure

73
00:04:59,820 --> 00:04:59,940
that.

74
00:05:00,010 --> 00:05:05,830
Something hasn't gone majorly wrong or you're not completely stuck or just for whatever reason, I really,

75
00:05:05,830 --> 00:05:11,290
really want you to persevere and try your best to actually write the code yourself and to solve the

76
00:05:11,290 --> 00:05:14,290
issues and figure out how to make all the test pass.

77
00:05:14,860 --> 00:05:19,410
But if you need to look at the solution, they are available on Split.

78
00:05:19,420 --> 00:05:23,440
So just click on this link and it'll take you to the solution page.

79
00:05:23,620 --> 00:05:28,300
In order to see the files, you can either fork the apple as you have done before.

80
00:05:28,570 --> 00:05:35,890
You'll get a copy of this solution file or what I think is much simpler is simply click on show files

81
00:05:36,370 --> 00:05:39,550
and then click on this main maned py file.

82
00:05:39,670 --> 00:05:45,970
And then you will see the solution code on this page without having to fork a copy of this rappel.

83
00:05:46,000 --> 00:05:47,860
But you can do it any number of ways.

84
00:05:47,860 --> 00:05:50,620
Whichever way suits you best is fine.

85
00:05:50,740 --> 00:05:57,370
Now, once you have written your code correctly, you should be able to see all the tests pass and passing.

86
00:05:57,670 --> 00:06:02,860
It means that there's a little tick along each of these and you'll see in this one, there's only one

87
00:06:02,860 --> 00:06:05,960
test and this is passed, so you get a score of 100 percent.

88
00:06:06,400 --> 00:06:12,580
And the actual output that your code is created in the console now looks exactly same as expected.

89
00:06:12,940 --> 00:06:18,670
So you are now done and you can go back to your other assignments and you can continue.

90
00:06:19,360 --> 00:06:26,350
So this is a really simple interface, and we've switched to this from Split because it actually disabled

91
00:06:26,410 --> 00:06:30,280
their classroom technology, which looks basically exactly the same as this.

92
00:06:30,700 --> 00:06:35,080
And we wanted to provide you the best learning experience possible.

93
00:06:35,090 --> 00:06:37,060
So we've switched over to coding rooms.

94
00:06:37,450 --> 00:06:41,050
And you should be able to sign up and get started without any issue.

95
00:06:41,440 --> 00:06:47,890
Now, remember, at the end of the lesson, I will go through the solution with you step by step, explaining

96
00:06:47,890 --> 00:06:48,880
the solution as well.

97
00:06:49,150 --> 00:06:50,050
So if you get stuck?

98
00:06:50,230 --> 00:06:52,840
Don't worry, I'm here for you every step of the way.

99
00:06:53,140 --> 00:06:59,140
But now it's time for you to pause the video and make sure that you've signed up for coding rooms already

100
00:06:59,140 --> 00:07:05,290
registered for a student account and then click on the link in Step two in the course resources and

101
00:07:05,290 --> 00:07:12,160
sign up for our course and then go over to the first exercise printing and give it a go.

102
00:07:12,340 --> 00:07:13,570
All right, pause the video now.

103
00:07:14,080 --> 00:07:14,500
All right.

104
00:07:14,530 --> 00:07:15,550
How did you get on?

105
00:07:16,030 --> 00:07:20,890
I really hope you gave this a good go because it's in these moments where you're going to be learning

106
00:07:20,890 --> 00:07:21,340
the code.

107
00:07:21,700 --> 00:07:26,240
Unfortunately, no amount of listening to me talk is actually going to give you these skills.

108
00:07:26,260 --> 00:07:31,630
It's only when you actually try it out and get the computer to do the thing that you wanted to do.

109
00:07:31,870 --> 00:07:35,680
That's when you become the master of the computer, also known as a programmer.

110
00:07:36,250 --> 00:07:38,740
So in this case, the instructions are pretty simple.

111
00:07:38,830 --> 00:07:44,740
We have to use what we learn about the print statement to output these three lines and notice how,

112
00:07:44,740 --> 00:07:48,340
in the skip, the lines are printing out in separate lines.

113
00:07:48,850 --> 00:07:54,280
This one gets printed than this one than this one, but because it happened so fast, it seems like

114
00:07:54,280 --> 00:07:56,560
as if they're getting printed as a single block.

115
00:07:57,130 --> 00:08:02,800
So we're told to write our code below this line, and we know that in order to print something, we

116
00:08:02,800 --> 00:08:05,960
use the print function with a set of parentheses.

117
00:08:06,280 --> 00:08:10,600
And inside the parentheses is where we tell it what we want it to print.

118
00:08:11,020 --> 00:08:15,850
So in the first instance, it's day one space.

119
00:08:15,910 --> 00:08:23,740
Then it's now it's really easy to make spelling mistakes, but I really encourage you to actually type

120
00:08:23,740 --> 00:08:28,960
out anything that you put into your code rather than just simply copying and pasting it.

121
00:08:29,350 --> 00:08:31,670
Now, of course, it works exactly the same way.

122
00:08:31,690 --> 00:08:39,370
I could just copy and paste the code in here, but it's often in these cases where you make mistakes

123
00:08:39,370 --> 00:08:44,590
like, for example, forgetting to add the double quotes around the text that you want to print.

124
00:08:45,220 --> 00:08:50,260
I really recommend just typing out the code for practice whenever you're doing these code challenges.

125
00:08:51,640 --> 00:08:55,750
Now, the last line that we want to print is a little bit complicated.

126
00:08:56,080 --> 00:09:02,050
It's almost like print inception, because what we want to print is this function.

127
00:09:02,140 --> 00:09:04,240
This is how we write our function.

128
00:09:04,750 --> 00:09:08,980
And that has to go inside here inside a set of double quotes.

129
00:09:09,430 --> 00:09:13,120
So let's open up a double quotes and then write our print statement.

130
00:09:13,690 --> 00:09:17,740
And in this case, I'm actually using a single quote.

131
00:09:18,250 --> 00:09:21,490
And I'll tell you just in a little moment why that is.

132
00:09:22,420 --> 00:09:24,020
So let's add that simple quote.

133
00:09:24,040 --> 00:09:30,370
And finally, the closing parentheses this now is the entire code that you would need to be able to

134
00:09:30,370 --> 00:09:31,330
print something out.

135
00:09:31,930 --> 00:09:37,060
And when I go ahead and click run, you can see that the output looks exactly the same as what we've

136
00:09:37,060 --> 00:09:38,080
got here in the GIF.

137
00:09:38,410 --> 00:09:43,900
This is what we want, and when I click submit, you'll see that my tests all pass.

138
00:09:44,200 --> 00:09:48,760
And I can now submit my assignment, and I've now completed the coding challenge.

139
00:09:49,420 --> 00:09:55,750
Now, coming back to this single quote, why is it that I've got a single quote here rather than a double

140
00:09:55,750 --> 00:09:58,180
quote, which is what we've been using all this time?

141
00:09:58,630 --> 00:09:59,350
Well, because in.

142
00:09:59,550 --> 00:10:07,280
Python, it doesn't actually care whether if you enclose the strings, so these pieces of text are not

143
00:10:07,280 --> 00:10:13,280
to be interpreted as code inside single quotes or inside double quotes.

144
00:10:13,550 --> 00:10:15,920
It is identical to the computer.

145
00:10:16,220 --> 00:10:18,290
This honey badger literally doesn't care.

146
00:10:18,950 --> 00:10:27,140
But if you had a set of double quotes and then you wanted another set of double quotes inside the double

147
00:10:27,140 --> 00:10:27,560
quotes.

148
00:10:27,980 --> 00:10:34,400
So, for example, if I replace this with double quotes, you'll see that already the syntax highlighting

149
00:10:34,400 --> 00:10:35,900
is already screaming out to us.

150
00:10:36,200 --> 00:10:44,960
This something that's not quite right here because the colors are not the same as here, where the print

151
00:10:44,960 --> 00:10:47,420
function is in a particular color.

152
00:10:47,750 --> 00:10:54,290
The parentheses are in a particular color, and the text that is to be printed is in a yet another different

153
00:10:54,290 --> 00:10:54,650
color.

154
00:10:55,010 --> 00:10:59,210
In this case, it looks all jumbled up and we're getting some errors here.

155
00:10:59,870 --> 00:11:03,320
So now if I hit run, you'll get syntax errors.

156
00:11:04,250 --> 00:11:12,860
And the problem here is, of course, this is, of course, all code things at the end of this string

157
00:11:12,860 --> 00:11:13,640
is here.

158
00:11:14,150 --> 00:11:17,450
And so it doesn't know what on earth is going on afterwards.

159
00:11:18,290 --> 00:11:21,440
And instead, it's seeing this as a string.

160
00:11:21,860 --> 00:11:26,690
This as a string, and this is being interpreted as code.

161
00:11:27,770 --> 00:11:34,310
So when we want to use some double quotes inside another set of double quotes, commonly you'll see

162
00:11:34,310 --> 00:11:37,820
people switch to single quotes instead.

163
00:11:38,390 --> 00:11:45,590
So you could, for example, write the print statement like so and use double quotes if you want to

164
00:11:45,590 --> 00:11:46,520
print those out.

165
00:11:47,120 --> 00:11:52,820
Or you can do it the other way, which is what I had before, where we use all double quotes on the

166
00:11:52,820 --> 00:11:54,980
outside and single quotes on the inside.

167
00:11:55,490 --> 00:11:58,520
So have a play around with that, if that's at all confusing.

168
00:11:58,850 --> 00:12:03,130
But once you've tried it a few times and switched it around a few times, it should become clear of

169
00:12:03,140 --> 00:12:04,220
what it's actually doing.

170
00:12:05,000 --> 00:12:07,340
How did you get on with this challenge?

171
00:12:07,820 --> 00:12:11,570
If you ever need to see the solution, it's always down here as a link.

172
00:12:12,440 --> 00:12:15,360
So I hope you enjoy this challenge in the next lesson.

173
00:12:15,380 --> 00:12:21,620
We're going to get back to learning about Python, and we'll get to learn about strings and string manipulation.

174
00:12:22,220 --> 00:12:23,570
All of that and more.

175
00:12:23,690 --> 00:12:24,350
I'll see you there.

