[
{
"Id":1267,
"slot":0,
"codename":"beans",
"name":"apple1"
},
{
"Id":1268,
"slot":1,
"codename":"pineapple",
"name":"potato"
},
{
"Id":1269,
"slot":2,
"codename":"chil",
"name":"ball"
},
{
"Id":1270,
"slot":3,
"codename":"apple",
"name":"banana"
}
],
import json
json_str = '[{"Id":1267,"slot":0,"codename":"beans","name":"apple1"},{"Id":1268,"slot":1,"codename":"pineapple","name":"potato"},{"Id":1269,"slot":2,"codename":"chil","name":"ball"},{"Id":1270,"slot":3,"codename":"apple","name":"banana"}]'
json_obj = json.loads(json_str)
# если отдельный элемент проверить
if json_obj[0].get("slot") != None:
print("ok")
else:
print("not ok")
for item in json_obj:
if item.get("slot") != None:
print("ok")
else:
print("not ok")