Open mbecker3 opened 6 years ago
Great question!! You need to create 2 lists first. subjects = ('name', 'age', 'food') values = ('Lest Turtles', 42, 'cereal') Then create your dictionary(I found this way online, should not make you have to write it all out) a_dict = {} junk = map(lambda k, v: a_dict.update({k: v}), subjects, values)
I want to create a dictionary from two lists. Online, it says that one way to do it is to simply create a new dictionary and type out all of the keys from both lists. However, depending on the number of keys in the dictionary, this could be a lengthy process. Is there an easier way to do this?