Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Dictionary convert 2 lists into a dictionary, use zip()

# convert 2 lists into a dictionary, use zip()

aa = [1, 2, 3]
bb = ["a", "b", "c"]

print(dict(zip(aa, bb)))
# {1: 'a', 2: 'b', 3: 'c'}
Source by xahlee.info #
 
PREVIOUS NEXT
Tagged: #Dictionary #convert #lists
ADD COMMENT
Topic
Name
5+5 =