iteritems method returns an iterator instead of a list : iteritems « Dictionary « Python Tutorial






d = {'title': 'Python Web Site', 'url': 'http://www.python.org', 'spam': 0}

it = d.iteritems()
print it
print list(it) # Convert the iterator to a list








8.15.iteritems
8.15.1.iteritems method returns an iterator instead of a list
8.15.2.Swap keys for values
8.15.3.The keys, values, and items Functions