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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The code works when I run it in VS Code so that's why I was confused. I still don't understand how my code can pass all the tests and still produce an error.
So for this kata I wrote a solution that did not manipulate the original list. I passed all of the tests but when I go to attempt my soultion I passed all 4 tests and then get an STDERR: error that says this:
Traceback (most recent call last):
File "main.py", line 16, in
Test.assert_equals(binary_array_to_number(array), n,"It should work for random inputs too")
File "/home/codewarrior/solution.py", line 13, in binary_array_to_number
num.append(digit * binary[ind])
KeyError: 4
Does anyone know how to fix this?
P.S I did not use the reverse() as I see in other comments