How to fix TypeError: 'int' object is not subscriptable in Python | DevErrors