Python dictionary creation error
问题 I am trying to create a Python dictionary from a stored list. This first method works >>> myList = [] >>> myList.append('Prop1') >>> myList.append('Prop2') >>> myDict = dict([myList]) However, the following method does not work >>> myList2 = ['Prop1','Prop2','Prop3','Prop4'] >>> myDict2 = dict([myList2]) ValueError: dictionary update sequence element #0 has length 3; 2 is required So I am wondering why the first method using append works but the second method doesn't work? Is there a