1
00:00:04,840 --> 00:00:07,840
Let's talk now about default parameter
values.

2
00:00:23,830 --> 00:00:29,730
you saw me go ahead then and add
comma 66 to each line, to fix it.

3
00:00:47,060 --> 00:00:51,400
So what that means is, we can give our
screen_width parameter a default value.

4
00:00:51,400 --> 00:00:56,220
So I can come up here, on line one,
in the definition, put equals 80.

5
00:00:56,620 --> 00:01:01,580
80 is a sensible default, because that's
the default width of many terminals.

6
00:01:01,580 --> 00:01:04,840
It's usual not to put a
space either side of the equals, when

7
00:01:04,849 --> 00:01:08,810
providing default values. So if we call
our function without providing an

8
00:01:08,810 --> 00:01:13,490
argument for the screen width, the
default value of 80 will be used. So to

9
00:01:13,490 --> 00:01:16,850
test that, what I'm going to do is delete
the argument from the first five

10
00:01:16,850 --> 00:01:21,000
function calls, on lines 14 through 18.
I'll quickly do that now -

11
00:01:21,000 --> 00:01:23,820
just fast forward this bit.

12
00:01:24,330 --> 00:01:28,850
Okay, you can see that's done. Run the program now,

13
00:01:29,160 --> 00:01:32,560
and you can see we've now got a different
width for the first five lines.

14
00:01:32,560 --> 00:01:36,840
We haven't provided a screen argument, so we
get 80 characters - that's the default

15
00:01:36,850 --> 00:01:42,270
that we set, back up here on line one. So our banner

16
00:01:42,270 --> 00:01:44,730
looks horrible now, but I'm sure you
don't want to watch me deleting

17
00:01:44,730 --> 00:01:48,060
arguments. What I'll do is, just to
confirm that 80 is being used as the

18
00:01:48,060 --> 00:01:53,510
default, is change the next two lines to
80. Let's go ahead and do that.

19
00:01:55,360 --> 00:02:02,900
Alright, so I'm going to change line 19
to 80, and line 20 also to 80.

20
00:02:02,900 --> 00:02:05,880
Alright, so run the program now,

21
00:02:06,720 --> 00:02:09,880
and you can see the output of those two
lines I just changed, and I used the

22
00:02:09,880 --> 00:02:14,600
same width as the previous lines. Alright, so that's default parameter values.

23
00:02:14,600 --> 00:02:19,560
You provide the default value after the
parameter name, using the equal symbol,

24
00:02:19,560 --> 00:02:23,570
and you saw that on line one. That's the
same as when binding a variable to a

25
00:02:23,570 --> 00:02:27,320
value and it shouldn't look surprising.
Alright, so I'll leave you to tidy up the

26
00:02:27,320 --> 00:02:32,100
remaining four lines, and in the next video,
we'll talk about keyword arguments.

27
00:02:32,100 --> 00:02:35,040
See you in the next video.

