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.
Now I get it. Thank you!
You have a misunderstanding of something.
n
is a number.str(n)
turns it into a string.strip
just removes the leading and trailing characters. All of this 'launches' in both cases. Theint
throws an error if it receives an empty string, which is the case if input is only zeros, since you strip them.This comment is hidden because it contains spoiler information about the solution
It doesn't skip anything. Python's
or
statement returns the left side if it is true and with strings that is whenever the string is not empty. Only when the left side is false does it proceed to evaluate the right side and it returns it regardless of is it true or false.This comment is hidden because it contains spoiler information about the solution