두 개의 목록이 있다고 가정 해 봅시다.파이썬 3.3에서 루프를 통해 키와 값을 사전에 반복하십시오.
>>> List1 = ['This', 'is', 'a', 'list']
>>> list2 = ['Put', 'this', 'into', 'dictionary']
>>> d = {}
어떻게 명시 적으로부터
>>> d = {'This': 'Put', 'is': 'this', 'a': 'into', 'list': 'dictionary'}
http://stackoverflow.com/questions/209840/map-two-lists-into-a-dictionary-in-python –
'zip'에 대해 알고 계십니까? 그렇다면, 이것은 사소한 것입니다. 그렇지 않다면 [docs] (http://docs.python.org/3/library/functions.html#zip)를 읽으십시오. 그러면 간단합니다. – abarnert