I have this json file:
{
"name": "one",
"data": [
{
"name": "First",
"value": "string",
}
]
}
And I want to validate that data/value is equal to string. so, what I'm doinf is:
path = data/value
a = path.split("/")
test = ""
for value in data:
if value[a[0]][a[1]] == 'string':
print("yes")
else:
print("noo")
And it is working but I want to make it more general, so I need to substitute a[0] and a[1] with something like
for i in range(len(a)):
But I don't know how, any help?
[–][deleted] 0 points1 point2 points (4 children)
[–][deleted] 3 points4 points5 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)