dictionaries and 'in' in 2.1

Sean 'Shaleh' Perry shalehperry at home.com
Sat Nov 3 17:16:50 EST 2001


On 03-Nov-2001 John J. Lee wrote:
> 
> The Python 2.1.1 manual, section 2.1.6, says:
> 
>   k in a        1 if a has a key k, else 0
> k not in a      0 if a has a key k, else 1
> 
> 

Odd, I thought you had to do "key in dict.keys()".




More information about the Python-list mailing list