Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
104 Vizualizări

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 :)

Imagine profil
Abandonează
Cel mai bun răspuns

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] 

Imagine profil
Abandonează
Cel mai bun răspuns

res[project_id'][0] will print 5

res[project_id'][1] will print toto114 

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mar. 25
1151
0
ian. 25
3196
1
aug. 23
14464
1
aug. 23
13153
1
iul. 23
10154