Is there a more concise way of doing this in Python?:
def toDict(keys, values): d = dict() for k,v in zip(keys, values): d[k] = v return d
Yes:
dict(zip(keys,values))
2.1m questions
2.1m answers
60 comments
57.0k users