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.
I know that lambda is anonymous function, and there's no need to create variable for lambda, but here we need to meet the interface requirements. Requirement here is that
check
is callable.In real world I would not create function for this one liner, that's why I'm showing solution with
lambda
.You need more corner-case tests here
I'm not happy with this kata. Using builtin function is not cheating when in description is no information about not using this.
Also this "anti-cheat" was not giving me option to name my variable
max
:/Hi, after attempts I have this error. Should it be visible or I just made something wrong?
Traceback (most recent call last):
File "main.py", line 60, in
rand = sample([x for x in c.dict.keys() if not str(x).startswith('__')], 1)[0]
File "/usr/local/lib/python2.7/random.py", line 325, in sample
raise ValueError("sample larger than population")
ValueError: sample larger than population