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.
Not anymore ;-)
Since it's been three weeks, I think I can resolve this question as answered.
Python 2 uses "int math" so
5 / 2 == 2
. Along with print statements, that's one of the most common things to watch out for when switching between Python 2 and Python 3. Int math was originally used in order to keep types consistent (divide two ints, get back an int), but for Python 3 it was changed to float math (divide two ints, get back a float) so that it behaves as expected.To perform float math with Python 2, you have to cast the numerator and/or the denominator to a float like
float(5) / 2 == 2.5
or5 / float(2) == 2.5
orfloat(5) / float(2) == 2.5
Please have a look at http://www.codewars.com/docs/comment-markdown and learn about proper formatting.
That being said, your code is probably too slow. Add the error message. Also note that Codewars runs Python 2.7.