更新时间:2023-09-13 23:34:58
在打印字典时(例如, print(dictionary)
),键的 repr
并显示值.
When printing a dict, (e.g. print(dictionary)
), the repr
s of the keys and values are displayed.
相反,请尝试:
dictionary = {u"Hello" : u"你好"}
for key,value in dictionary.iteritems():
print(u'{k} --> {v}'.format(k=key,v=value))
产量:
Hello --> 你好