What is the difference between dict.items() and dict.iteritems() in Python2?

后端 未结 10 696
天命终不由人
天命终不由人 2020-11-22 08:10

Are there any applicable differences between dict.items() and dict.iteritems()?

From the Python docs:

dict.items(): Return a

10条回答
  •  长情又很酷
    2020-11-22 08:20

    dict.iteritems is gone in Python3.x So use iter(dict.items()) to get the same output and memory alocation

提交回复
热议问题