这是我的字典
dict = {'apple':'der Apfel', 'ant':'die Ameise', 'asparagus':'der Spargel'}
我想得到一个输出:
dictionary for a
apple: der Apfel
ant:die Ameise
asparagus:der Spargel
我是字典新手,请帮忙
我试着做
def tutorial8_part2():
dict = {'apple':'der Apfel', 'ant':'die Ameise', 'asparagus':'der Spargel'}
dictList = dict.items()
for key, value in dict.iteritems():
temp = []
aKey = key
aValue = value
temp.append(aKey)
temp.append(aValue)
dictList.append(temp)
print dictList.append(temp)
但它不工作