(Key) Membership (in, not in) : Member « Dictionary « Python Tutorial






dict2 = {'name': 'earth', 'port': 80}
print 'name' in dict2
print 'phone' in dict2
8.20.Member
8.20.1.Iterating Through a Dictionary
8.20.2.(Key) Membership (in, not in)