Catch an IndexError

Reach for an item past the end of a list. Catch the IndexError and store a safe default instead.
Python
Setting up Python environment...
Output