Iterating Through a Dictionary : Member « Dictionary « Python Tutorial






import os 
for k, v in os.environ.items(): 
    print "%s=%s" % (k, v) 


print "\n".join(["%s=%s" % (k, v) for k, v in os.environ.items()])








8.20.Member
8.20.1.Iterating Through a Dictionary
8.20.2.(Key) Membership (in, not in)