Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

handle dict invalid key python

myDict = {0: 'Hello', 1: 'World'}
0 in myDict
# >>> True
2 in myDict
# >>> False
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #handle #dict #invalid #key #python
ADD COMMENT
Topic
Name
5+6 =