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