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.
'Programming' 카테고리의 다른 글
[Python/OpenBook] 예제로 배우는 재미있는 Python (0) | 2012.05.29 |
---|---|
[Python] Python Debugger - pdb 기본 사용법 (0) | 2012.05.29 |
Python if statements (0) | 2012.05.29 |
How do I generate random numbers in Python? (0) | 2012.05.29 |
Python is Cool (and Perl is not), Especially for C/C++ Programmers (0) | 2012.05.29 |