1
00:00:05,000 --> 00:00:09,080
Alright, so this is a palindrome
challenge solution. How did you get on?

2
00:00:09,080 --> 00:00:13,440
Did you manage to actually solve it?
Well there's 3 string methods you could have used,

3
00:00:13,440 --> 00:00:18,760
although .upper and .casefold
generally work better than .lower.

4
00:00:18,760 --> 00:00:23,240
I'll use .casefold in my solution.
The code we need to change is

5
00:00:23,240 --> 00:00:28,249
on line 9, which is where we perform the
comparison of the two strings. The code

6
00:00:28,249 --> 00:00:31,489
I'm going to add is, firstly, after the
right square bracket, we're going to add

7
00:00:31,489 --> 00:00:36,350
.casefold there, to call that method,
and then I'm going to add another equivalent

8
00:00:36,350 --> 00:00:42,350
call there, after string.casefold,
also leaving the parentheses in. Now that

9
00:00:42,350 --> 00:00:45,350
we've done that, both strings get
converted to lower case before we

10
00:00:45,350 --> 00:00:50,380
compare them. I'm going to run the program
again now and we'll test this out.

11
00:00:50,460 --> 00:00:56,420
I'll type in the word radar again, with a capital R.
This time you can see that it's working

12
00:00:56,430 --> 00:01:01,829
and we'll just try something else -
Python to make sure - it still fails,

13
00:01:01,829 --> 00:01:06,330
and that is working fine. Alright, so we
didn't actually have to change any of

14
00:01:06,330 --> 00:01:11,009
our main code. That's another advantage
of functions. When you fix a problem with

15
00:01:11,009 --> 00:01:16,850
your function, all the code that calls
it gets the advantage of the fix.

16
00:02:53,420 --> 00:02:55,530
Have a go, and I'll go over my solution to it

17
00:02:55,530 --> 00:02:58,400
in the next video.

