Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Firstly remove pass. it's only used when we need a statement, but don't want to put code, like for Java, we'd have to put some filler command like "System.out.print("");" in that function as it can't be empty.
Moving onto the question, since you're already reducing the length you need to act on ( for example, if your string is 'hello', then "len(string)-4" will imply, you'll just read 'h' ), so you don't need to use if-else.
Finally, you need to RETURN the encoded sting instead of printing it, so you'll have to convert that list back to a string.
I used the following code to do that:
codedstring = "".join(map(str, cc)
return codedstring
Also, in your function body use another variable name like "cc_new" instead of "cc" but that's just my opinion.( cc_new = list(cc) )
This comment is hidden because it contains spoiler information about the solution