import json
num = {
"users": [{
"id": 12
}]
}
filename = "user.json"
with open(filename, "w") as f:
json.dump(num, f)
with open(filename) as f:
t = json.load(f)
t = t["users"]["id"]
print(t)
TypeError: list indices must be integers or slices, not str