Although I can access the list and see the elements of the list. I am unable to access the individual elements of the list. Upon trying to access any element, I am getting "list index out of range" error
Person_CUID=[]
Family_ID=[]
Age=[]
for key in df_demographics.keys():
for k,v in df_demographics[key].items():
#print("Actual Key:%s" %key)
#print("key:%s"%k)
#print("Value:%s"%v)
if key.find('Family_ID')>=0 and k>0:
Family_ID.append(v)
elif key.find('Client Unique ID (CUID)')>=0 and k>0:
Person_CUID.append(v)
elif key.find('Age')>=0 and k>0:
Age.append(v)
elif key.find(key)>=0 and key.find('Metric Name')<0 and key.find('CBO_ID')<0 and key.find('Family_ID')<0 and k==0:
Metric1=v
elif key.find(key)>=0 and key.find('Metric Name')<0 and key.find('CBO_ID')<0 and key.find('Family_ID')<0 and k>=1:
Metric1_value=v
#for k,v in enumerate(Age):
# print(k,v)
#for i in range(len(Age)):
#print(Age[i])
print(Age[k-1)
else:
pass```
I am able to access the elements separately if I use another `for x in range loop` but that would make my elements repeat