iteritems:以迭代器对象返回字典键值对

item:以列表形式返回字典键值对

>>> dic = {'a':3,'c':1,'b':2}
>>> print dic.iteritems()
<dictionary-itemiterator object at 0x7fa381599628>
>>> print dic.items()
[('a', 3), ('c', 1), ('b', 2)]

 两个返回的结果都可迭代

相关文章:

  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2021-08-12
猜你喜欢
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
相关资源
相似解决方案