How to fix IndexError: list index out of range in Python | DevErrors