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.
Oh neat!
We learned new stuff.
First and foremost "return n if n < 10" is the base case.
The map function applies a given function (in this case "int") to every item of something that is iterable. -> new for me!
Using the string function on the input n, you turn n into a string which is iterable. Therefore the map functiion can now apply a given function to each character of a string. -> the clever part!
Once the map function is done applying int to every digit, it is then all summed together.
This comment is hidden because it contains spoiler information about the solution
I do enjoy seeing the one liners. It lets me learn more about how flexible Python can be.