Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
96 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

res[project_id'][0] will print 5

res[project_id'][1] will print toto114 

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mar 25
1110
0
Jan 25
3162
1
Agu 23
14389
change password Diselesaikan
1
Agu 23
13102
1
Jul 23
10102