Хочу получить все 'src_big'
dict = {
"response": {
"62": {
"type": "photo",
"photo": {
"src_big": "https://pp.userapi.com/xxxx.jpg"
}
},
"58": {
"type": "photo",
"photo":
"src_big": "https://pp.userapi.com/yyyy.jpg"
}
}
}
}
x = dict['response']
sizes = [x[i]['photo'] for i in x]
print(sizes)
Получаю
File "/home/script.py", line 3623, in main
sizes = [x[i]['photo'] for i in x]
File "/home/script.py", line 3623, in <listcomp>
sizes = [x[i]['photo'] for i in x]
TypeError: 'int' object is not subscriptable