I am pulling data via an API that python identifies as a list, but does not seem to act like one.
This is a sample of the data returned:
[{'product_id': '41111', 'type': 'configurable', 'set': '4', 'sku': 'CM5555-CONF', 'position': '1'}, {'product_id': '42222', 'type': 'configurable', 'set': '4', 'sku': 'CM6666-CONF', 'position': '1'}
This is in a varaiable called temp.
When I do print(type(temp)), <class 'list'>
is returned.
I am trying to access a list of all product IDs, so they can be fed to a different request to the API.
When I do print(temp[::1])
, the entire list (or whatever it is) is returned, as though I just did print(temp)
by itself.
How can I print just a list of product_ids by themselves?