python——返回一個view對象,key的列表
提問人:楊紫紅發(fā)布時間:2020-11-20
d = {1:"one", 2:"two", 3:"three"}
for key, value in d.viewitems():
print "%s - %s" % (key, value)
#1 - one
#2 - two
#3 - three
viewkeys() ---返回一個view對象,key的列表
繼續(xù)查找其他問題的答案?
相關(guān)視頻回答
d = {1:"one", 2:"two", 3:"three"}
for key, value in d.viewitems():
print "%s - %s" % (key, value)
#1 - one
#2 - two
#3 - three
viewkeys() ---返回一個view對象,key的列表
點(diǎn)擊加載更多評論>>