1
00:00:00,810 --> 00:00:01,950
In this exercise,

2
00:00:01,950 --> 00:00:04,470
the goal is to do some debugging.

3
00:00:04,470 --> 00:00:07,290
We're going to identify what's wrong with the code

4
00:00:07,290 --> 00:00:10,830
and fix it so that it works as expected.

5
00:00:10,830 --> 00:00:13,410
Now the goal is when you hit Run Code

6
00:00:13,410 --> 00:00:16,890
it should print out the example output exactly

7
00:00:16,890 --> 00:00:19,080
as seen in the description pane.

8
00:00:19,080 --> 00:00:20,790
If the description pane is not open

9
00:00:20,790 --> 00:00:22,230
remember you can always click

10
00:00:22,230 --> 00:00:25,740
on that big i button in order to bring it up.

11
00:00:25,740 --> 00:00:29,040
So you might see a certain number of errors

12
00:00:29,040 --> 00:00:30,990
when you hit the Run Code button

13
00:00:30,990 --> 00:00:34,140
without making any changes to the code.

14
00:00:34,140 --> 00:00:36,240
And based on what those errors tell you

15
00:00:36,240 --> 00:00:39,780
or based on your knowledge of the print statement in Python,

16
00:00:39,780 --> 00:00:41,700
you should be able to fix the code

17
00:00:41,700 --> 00:00:44,130
so that it works correctly.

18
00:00:44,130 --> 00:00:45,840
Once the output

19
00:00:45,840 --> 00:00:49,380
in the output pane matches the example output exactly

20
00:00:49,380 --> 00:00:51,780
then you can feel free to hit the Submit button

21
00:00:51,780 --> 00:00:53,580
and check your code.

22
00:00:53,580 --> 00:00:54,870
And once you're done,

23
00:00:54,870 --> 00:00:55,980
or if you get stuck,

24
00:00:55,980 --> 00:00:57,780
remember you can hit the Next buttonâž¡

25
00:00:57,780 --> 00:01:00,360
and I'll run through the solution together with you.

26
00:01:00,360 --> 00:01:01,503
So have a go now.

27
00:01:06,540 --> 00:01:08,460
Let's go through the solution together.

28
00:01:08,460 --> 00:01:10,440
In the first print statement

29
00:01:10,440 --> 00:01:14,460
we're missing a double quote before the word "Day".

30
00:01:14,460 --> 00:01:17,550
That way we can tell the computer

31
00:01:17,550 --> 00:01:20,280
which part of our entire line

32
00:01:20,280 --> 00:01:22,740
is the text that we want printed out.

33
00:01:22,740 --> 00:01:24,930
Now, if those double quotes are not matched,

34
00:01:24,930 --> 00:01:28,170
such as in the error code to begin with,

35
00:01:28,170 --> 00:01:29,550
then the computer doesn't know

36
00:01:29,550 --> 00:01:31,590
which part should be printed out.

37
00:01:31,590 --> 00:01:33,900
By adding that double quote

38
00:01:33,900 --> 00:01:36,540
we fix the first print statement.

39
00:01:36,540 --> 00:01:38,460
In the second print statement,

40
00:01:38,460 --> 00:01:42,870
the problem is that we have only double quotes.

41
00:01:42,870 --> 00:01:44,670
The way that double quotes work

42
00:01:44,670 --> 00:01:46,410
is the computer's going to look

43
00:01:46,410 --> 00:01:49,170
for the first double quote and assume

44
00:01:49,170 --> 00:01:52,980
what's between that and the second double quote

45
00:01:52,980 --> 00:01:56,550
that it sees as the text you want to print.

46
00:01:56,550 --> 00:01:58,470
Now, this is complicated by the fact

47
00:01:58,470 --> 00:02:00,630
that we've got that plus symbol

48
00:02:00,630 --> 00:02:03,390
that we want to show in our print statement.

49
00:02:03,390 --> 00:02:07,500
The fix for this is to alternate the type of quote.

50
00:02:07,500 --> 00:02:10,560
So if we change the outer double quotes,

51
00:02:10,560 --> 00:02:13,470
the one just before the word "String"

52
00:02:13,470 --> 00:02:17,700
and just after the full stop to single quotes

53
00:02:17,700 --> 00:02:22,200
then our entire print statement makes sense to the computer

54
00:02:22,200 --> 00:02:26,850
and it sees that whole text inside the print statement

55
00:02:26,850 --> 00:02:28,710
as one block of text,

56
00:02:28,710 --> 00:02:30,930
and it knows that we want to print out

57
00:02:30,930 --> 00:02:32,880
the double quotes around the plus sign.

58
00:02:34,710 --> 00:02:36,990
In the third print statement,

59
00:02:36,990 --> 00:02:38,790
there is an extra indentation

60
00:02:38,790 --> 00:02:41,190
at the beginning of the line,

61
00:02:41,190 --> 00:02:42,930
and remember that in Python

62
00:02:42,930 --> 00:02:45,780
it's very sensitive to indentation.

63
00:02:45,780 --> 00:02:50,040
It views that as separate from no indentation.

64
00:02:50,040 --> 00:02:51,720
So it's really important

65
00:02:51,720 --> 00:02:55,290
that we keep our code files organized,

66
00:02:55,290 --> 00:02:56,123
and in this case

67
00:02:56,123 --> 00:02:59,070
if you simply just remove that extra indentation

68
00:02:59,070 --> 00:03:01,560
and make that print statement start

69
00:03:01,560 --> 00:03:03,030
at the beginning of the line,

70
00:03:03,030 --> 00:03:05,493
then we can fix this error.

71
00:03:06,630 --> 00:03:09,060
In the final error,

72
00:03:09,060 --> 00:03:12,510
we've got an extra opening parentheses

73
00:03:12,510 --> 00:03:14,970
in the print statement,

74
00:03:14,970 --> 00:03:17,040
and simply by removing it,

75
00:03:17,040 --> 00:03:20,160
it makes our code make sense.

76
00:03:20,160 --> 00:03:22,980
A print statement is comprised of the word "print",

77
00:03:22,980 --> 00:03:24,060
the opening bracket "(" ,

78
00:03:24,060 --> 00:03:25,470
and the closing bracket ")"

79
00:03:25,470 --> 00:03:29,430
and what goes inside that is just the text we want to print.

80
00:03:29,430 --> 00:03:32,760
We can't have any extra symbols or extra code.

81
00:03:32,760 --> 00:03:35,160
As you get along with writing more code,

82
00:03:35,160 --> 00:03:38,160
you'll become more familiar with the format

83
00:03:38,160 --> 00:03:40,140
and the way that code is written.

84
00:03:40,140 --> 00:03:42,900
So don't worry if you got stuck on some of these errors,

85
00:03:42,900 --> 00:03:44,700
it's just the learning process.

86
00:03:44,700 --> 00:03:45,870
And as long as you can go back

87
00:03:45,870 --> 00:03:49,290
and fix your code and understand why it now works

88
00:03:49,290 --> 00:03:51,213
then that's all I want to see.

