Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
99 Zobrazení

Hi guys!!!!!

Please i have this result :

[{'project_id': (5, u'toto114'), 'id': 21}]

I want to get the first value in project_id field which means the 5.

Please what can i do!!!!!

print res[project_id'][0]????

Thanks in advance :)

Avatar
Zrušit
Nejlepší odpověď

Let's assume,

result = [{'project_id': (5, u'toto114'), 'id': 21}]

If you want to get value "5" then use following syntex,

print result[0]['project_id'][0] 

Avatar
Zrušit
Nejlepší odpověď

res[project_id'][0] will print 5

res[project_id'][1] will print toto114 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
bře 25
1138
0
led 25
3180
1
srp 23
14408
1
srp 23
13128
1
čvc 23
10116