Programming

Python Mapping Types — dict

steloflute 2012. 5. 29. 19:08

http://docs.python.org/library/stdtypes.html#mapping-types-dict

 

키가 있는지 검사하려면 아래와 같이 한다:

 

key in d

Return True if d has a key key, else False.

New in version 2.2.

key not in d

Equivalent to not key in d.

New in version 2.2.

has_key(key)

Test for the presence of key in the dictionary. has_key() is deprecated in favor of key in d.