Skip to content
Advertisement

Error when retrieving nested list values in python

I have this as my code right now
main.py:

JavaScript

It returns the first list, but not the second one. Traceback:

JavaScript

How do I fix this?

Advertisement

Answer

Found a fix:

JavaScript

If the count is a multiple of 2, it is skipped (to prevent printing twice). If the count is equal to the amount of commands, the iteration is stopped.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement