DEV Community

Discussion on: TypeError: 'int' object is not subscriptable

Collapse
 
crhodes2 profile image
crhodes • Edited

I figured out what the problem is. I had assumed that my variable x was supposed to be my object, but what it really was, was an integer.
I went back to the drawing board to locate the actual object and got it to display what I wanted.
So... problem solved!

Collapse
 
kip13 profile image
kip

I said that in the below comment:

range only accept an integer or other object that can be interpreted like one.
Maybe the line when you get the items [x = my_request["jsonObject"]["items"]
] is wrong, you got the number of items not the items.

Good for you @crhodes, remember always read the doc about functions that you use.