1
00:00:05,200 --> 00:00:08,920
So how did you get on, adding another
parameter to our function definition?

2
00:00:08,920 --> 00:00:12,680
Well the change is quite simple - we just
need to add another parameter on line

3
00:00:12,680 --> 00:00:15,080
one, and delete line two. So let's have a go

4
00:00:15,080 --> 00:00:19,310
at doing that. So I'm going to put a comma
on line one in the parentheses after

5
00:00:19,310 --> 00:00:27,280
text, screen_width, then we're
going to delete line two.

6
00:00:27,280 --> 00:00:31,280
Alright, so our function now let's the
calling code specify the width.

7
00:00:31,280 --> 00:00:35,560
That change caused errors in our main code,
because we're not providing an argument

8
00:00:35,570 --> 00:00:39,140
for the width. I'm going to come back to
this in the next video.

9
00:00:39,140 --> 00:00:43,789
Ideally, any changes we make shouldn't
break existing code. There is a way to

10
00:00:43,789 --> 00:00:47,660
deal with this, and we'll be covering
that next. Before that, though, I'm going to use a

11
00:00:47,660 --> 00:00:52,920
width of 66. That should be wide enough
for the longest line in our banner.

12
00:00:52,920 --> 00:00:57,500
So what I'm going to do, is add a width as
the second argument on each line now,

13
00:00:57,500 --> 00:00:59,840
and I'll just fast forward this part of the
video so you're not wasting time

14
00:00:59,840 --> 00:01:02,600
watching me do it.

15
00:01:05,200 --> 00:01:08,980
Alright, so you can see that I've made the 
changes now. I've added a second argument,

16
00:01:08,980 --> 00:01:14,800
66 being the width, on lines 14
to 24. If we run the program now,

17
00:01:16,360 --> 00:01:21,240
we're back to getting output that looks good again.

18
00:01:21,540 --> 00:01:25,260
Alright, so that's my solution to the
challenge. Now you should also have used a

19
00:01:25,260 --> 00:01:29,040
value that's too small, at least once, to
check that your exception is still

20
00:01:29,040 --> 00:01:33,260
raised. So remember to test every
possible path through your functions.

21
00:01:33,260 --> 00:01:38,460
I won't do that on video, but if you didn't,
pause the video and do it now.

22
00:01:38,460 --> 00:01:42,090
Okay, so that's made our function more
flexible, but it was a bit annoying

23
00:01:42,090 --> 00:01:47,120
having to add comma 66 on each of those
lines. We made our function a bit better,

24
00:01:47,120 --> 00:01:51,600
but it's still not perfect. What would be
ideal, would be to provide a default

25
00:01:51,600 --> 00:01:54,920
value, if your calling code didn't
provide something.

26
00:01:54,920 --> 00:01:59,600
Well Python lets parameters have a
default value, using keyword arguments.

27
00:01:59,600 --> 00:02:03,600
We have come across them before. In the next
video, we'll learn how to use them in our

28
00:02:03,600 --> 00:02:07,670
own functions. See you in the next video.

