- [Instructor] In this Self Check exercise,
we'd like you to try out the methods
that you just learned in the preceding video.
So we start with the name, Margo Magenta,
with spaces on either side.
And we'd like you to go ahead and strip
all of the white space on either side,
then only the left,
and only the right white space as well.
So go ahead and pause the video to give that shot.
And come back for the answer.
Okay, let's go ahead and reveal everything here.
So as you can see, we have our name string, Margo Magenta,
and I'll just go ahead and execute
all of these at once here.
As you can see, when we execute just strip,
we remove both the leading and trailing white space,
lstrip removes only the leading space,
and rstrip removes only the trailing space.
None of these calls are modifying the original string.
So if I, for example, simply go in here and evaluate name,
you can see I still have the original string in memory.