Skip to Content
मेन्यू
This question has been flagged
2 Replies
217 Views

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
Discard
Best Answer

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
Discard
Best Answer

res[project_id'][0] will print 5

res[project_id'][1] will print toto114 

Avatar
Discard
Related Posts Replies Views Activity
0
मार्च 25
1411
0
जन॰ 25
3492
1
अग॰ 23
14845
1
अग॰ 23
13498
1
जुल॰ 23
10479