Chalarangelo/30-seconds-of-python

[FEATURE] Using dict for to_dictionary

geekypandey opened this issue · 0 comments

I totally understand their are preferences in the different choices between the different Python offering, so just suggesting one here for to_dictionary. Would love to hear your thoughts on it.

We could direct make use of the dict constructor which would make dictionary.

Current implementation

def to_dictionary(keys, values):
    return {key:value for key, value in zip(keys, values)}

Suggested implementation

def to_dictionary(key, values):
    return dict(zip(key, values))