I need to be able to get the index position of a certain item within a JSON file using Python so that I am able to append something to another item within that same position.
JSON below:
{
"members": [{
"username": "John Doe#0001",
"possesions": []
},
{
"username": "Samantha Green#0001",
"possesions": []
}
]
}
I need to find what position in members John Doe#0001 is in for example. So I can then append something to the possesions list like so:
data = json.load(jsonFile)
temp = data['members'][Index position]['possesions']
temp.append("something")
Ive tried googling to no success.