Dictionaries: Methods
Membership
Syntax: list.has_key(key)
E.g.
>>> l = {'item':'tire','price':20.99}
>>> l.has_key('item')
1
>>> l.has_key('brand')
0
Previous slide
Next slide
Back to first slide
View graphic version