Are there any applicable differences between dict.items() and dict.iteritems()?
From the Python docs:
dict.items()
: Return a
dict.iteritems()
: gives you an iterator. You may use the iterator in other patterns outside of the loop.
student = {"name": "Daniel", "student_id": 2222}
for key,value in student.items():
print(key,value)
('student_id', 2222)
('name', 'Daniel')
for key,value in student.iteritems():
print(key,value)
('student_id', 2222)
('name', 'Daniel')
studentIterator = student.iteritems()
print(studentIterator.next())
('student_id', 2222)
print(studentIterator.next())
('name', 'Daniel')