How to fix TypeError: list indices must be integers or slices, not str in Python | DevErrors