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 had not thought to use a copy of list. Thank you for such valuable advice.
The problem is you are modifying
a
at the same time you are iterating on it. This is something you should avoid since it can lead to weird / unexpected results. One solution could be to iterate over a copy ofa
(while still modifyinga
) or to work with indices Look at the other submitted solutions to see other ideas of code working here.For example, if you add
print(item)
at the entry of you first loop, you will see that on fixed test #6 the2
is never parsed.I did the same thing
Can anyonw tell me why my code only works when i have both for loops, and not just the first one (for item in a:)?