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.
if the names is an empty list, then f will be "-1". I think this will cause problem
You are welcome. Happy coding :)
This comment is hidden because it contains spoiler information about the solution
@Chris0lsen,
map
andfilter
are present in Python by default, whilereduce
is a part offunctools
module only in Python 3.@nagendra226, want to learn? Then google stuff, and use it - nobody's going to spoonfeed you, and nobody will help you with dumb questions all the time (especially, when google can find approximately 81,400 pages in just 0.43 seconds if you search for "what is functools").
functools is a PYthon library that gives the user access to functional programming methods such as map, filter and reduce
I've fixed the test cases anyway, so your code should work now.
Pick one.
Don't use
.popitem()
because you're messing up the tests with it.The line,
k = m.popitem()
modifies the input.Don't modify the input.
Please don't raise an issue if there is a promblem with your code. Post a question instead.
Also, make sure you flag your post as a spoiler if it contains your code.
Check your indenting.