Using the dictionary name will cause an iterator over that dictionary : loop through « Dictionary « Python Tutorial






dict2 = {'name': 'earth', 'port': 80}

for key in dict2:
     print 'key=%s, value=%s' % (key, dict2[key])
8.19.loop through
8.19.1.Using the dictionary name will cause an iterator over that dictionary