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.
ok, my bad then. Didn't know it worked different in python2 and python3. Thx for explanation
In Python 2.7, the
/
operator uses integer division and returns anint
if both operands areint
.This passed the kata so, maybe it works after all? :)
https://stackoverflow.com/questions/21316968/division-in-python-2-7-and-3-3
this doesn't work because of n / 2 part instead of n // 2. How is it possible that this is top ranked answear?
The best practice for iterating over a sequence when both the index and the value are required is to use the builtin enumerate() function: https://docs.python.org/2/library/functions.html#enumerate