Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python make dictionary based on list

lst = [('the', 7), ('car', 3), ('and', 3), ('tent', 2)]
newdct = {}
[newdct.update({k: v}) for k, v in lst]
 
PREVIOUS NEXT
Tagged: #python #dictionary #based #list
ADD COMMENT
Topic
Name
9+7 =