Computer Science, asked by Sushmita9395, 1 year ago

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

Answers

Answered by Aagmansriva993
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