00:01
Hello, welcome to this lesson.
00:02
In this lesson, we'll define a function in python called reverse.
00:08
What this function does is that it takes in a string.
00:14
And now this string should contain two adjacent adjectives, we should be able to interchange the two adjectives.
00:27
So the format of the adjectives should be one separated by the other with a comma in this space.
00:38
So say, for example, if we have the white trunk bow, as a string, it should return a string that is the trunk white bow.
01:02
Okay, so the first thing we do is that let's import the regressor's version for python.
01:11
Now let's define a test.
01:15
This equals to, so let's store it to that.
01:21
And now let's have the test, which is equals to the regressor's version in the sub.
01:31
Now we would have to match certain pattern in the string so that the regressor's version will work.
01:41
Now we want to match a weight, okay, that is followed by a comma.
02:01
Okay, now that comma is followed by a single white space.
02:09
And the single white space is also followed by a weight.
02:15
All right, so this is a pattern that we need to match.
02:20
And now this becomes a group of two.
02:23
Okay, so here we need to replace the second group, the second position, okay, with a space with a comma space and the first group.
02:51
Okay, then now we are, the string that we are looking at is the test...