콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
219 화면

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

아바타
취소
베스트 답변

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] 

아바타
취소
베스트 답변

res[project_id'][0] will print 5

res[project_id'][1] will print toto114 

아바타
취소
관련 게시물 답글 화면 활동
0
3월 25
1412
0
1월 25
3493
1
8월 23
14847
change password 해결 완료
1
8월 23
13498
1
7월 23
10479