Dark theme

Doctests


So, how did you do? Here's my version: test3.py. You'll notice that not only have I checked it is returning what I expected, but I've also double checked that it really is a list object. This is probably unnecessary (unless the file contains something very odd), but it does show how to check the type of something being returned.

So, we should be able to see that the issue is that the new function is reading the emoticons as strings, but despite the fact that they already have quote marks around them, it is adding quote marks to everything, meaning the string for each also has quotes inside it. When we do the replace, none of the emoticons are found, because they don't have quotes around them.

The problem is that split doesn't remove the quotes. Our easiest option is to loop through the list replacing "\"", i.e. a string containing the escaped double-quote character, with "", i.e. nothing. Can you do this using str.replace(search_string, replacement_string)? Change the code and check it now passes all the tests.