Suppose if the list is a collection of objects like given below:
obj = [
{
"subjectId" : "577a54c09c57916109142248",
"evaluableMaterialCount" : 0,
"subjectName" : "ASP.net"
},
{
"subjectId" : "56645cd63c43a07b61c2c650",
"subjectName" : ".NET",
},
{
"subjectId" : "5656a2ec3c43a07b61c2bd83",
"subjectName" : "Python",
},
{
"subjectId" : "5662add93c43a07b61c2c58c",
"subjectName" : "HTML"
}
]
You can use the following method to find the index. Suppose the subjectId is 5662add93c43a07b61c2c58c then to get the index of the object in the list,
subjectId = "5662add93c43a07b61c2c58c"
for i, subjobj in enumerate(obj):
if(subjectId == subjobj['subjectId']):
print(i)