Mögliche Duplizieren zur Liste:
How can I convert a Python dictionary to a list of tuples?Konvertieren von Python Wörterbuch
Ich versuche, einen Python-Wörterbuch in eine Python-Liste zu konvertieren, um einige Berechnungen durchzuführen.
#My dictionary
dict = {}
dict['Capital']="London"
dict['Food']="Fish&Chips"
dict['2012']="Olympics"
#lists
temp = []
dictList = []
#My attempt:
for key, value in dict.iteritems():
aKey = key
aValue = value
temp.append(aKey)
temp.append(aValue)
dictList.append(temp)
aKey = ""
aValue = ""
Das ist mein Versuch es ... aber ich kann nicht herausfinden, was los ist?
'Summe (dict.items(),())' – Natim