方法一:
spam = {'A':123 ,'B':345,'C':345 } for k,v in spam.items(): print(k,v)
方法二:
spam = {'A':123 ,'B':345,'C':345 } for k in spam: print(k,spam[k])
推荐使用方法二
方法一:
spam = {'A':123 ,'B':345,'C':345 } for k,v in spam.items(): print(k,v)
方法二:
spam = {'A':123 ,'B':345,'C':345 } for k in spam: print(k,spam[k])
推荐使用方法二