Python error: typeerror: ‘Int’ object is not subscriptable

Check the line where the error is reported, which is usually an integer with a subscript:
Such as:

a = 4
c=a[2]

Error: line 2, in <; module>
c = a [2]
TypeError: ‘int’ object is not subscriptable
Or a more complicated one: two dimensions
 

a = [1,2,3,4]
c=a[2][2]

It’s a one-dimensional array, but you take an array and then you subscript it, same problem.

Read More: