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.
This comment is hidden because it contains spoiler information about the solution
I am still very confused by this, having tried many combinations of str.encode and str.decode, I am still getting UnicodeEncodeError and UnicodeDecodeError. All the tests with just ASCII characters pass for me.
Well, I don't know if this was in response to your post, but I put "i.e." followed by the actual code you would use and the context of input and output. I'm hoping that's clear enough. If not, let me know.
As posed, this kata cannot be solved in Python.
The instructions say to "extend the string object", such that the syntax 'this is a string!!'.toBase64() would work.
But 'this is a string!!' in Python is a built-in object (str), which cannot be extended.
And behold, the test case doesn't make use of any "string object extension" but simply tests for the function toBase64(),
which is not part of any class of course.
The instructions should be amended to clarify what one should do for Python.
Instructions are still not mentioning which Unicode encoding to expect. (It seems to be UTF-8.)