I want to fetch all the respective ID's from the given text file but it is giving me empty list. kindly help me in this.
with open('json-data.txt') as f:
content = f.read()
#print(content)
runners = []
for index in range(len(content)):
for key in content[index]:
if key == 'active' and content[index][key] == True:
runners.append(content[index]['id'])
print(runners)Output:[]
Attached Files
