dict2 = {'name': 'earth', 'port': 80} for key in dict2.keys(): print 'key=%s, value=%s' % (key, dict2[key])