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 you have your order the other way, with red, yellow, green then you can do index - 1, and you won't hit your error - because 0 - 1 is -1 and that gives you the last item in the list - which is green, and the correct value.
Check your data types throughout.
You're able to debug by adding print() statements, so you could print out the inputs, and then check teh inputs for the one that isn't passing and work out why.
You can not 'sort' an integer, it's an operation that would make no sense to python.
So we need to change it to a datatype that python can sort - strings.