What is the difference between dict.items() and dict.iteritems() in Python?
Answers
Answered by
0
dict.items() return list of tuples, and dict.iteritems() return iterator object of tuple in dictionary as (key,value) . The tuples are the same, but container is different. dict.items() basically copies all dictionary into list. ... This clearly shows that dictionary.iteritems() is much more efficient.
Similar questions
India Languages,
6 months ago
Math,
6 months ago
Physics,
6 months ago
Physics,
1 year ago
Hindi,
1 year ago