Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dictionary get value if key exists

val = dict.get(key , defVal)  # defVal is a default value if key does not exist 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #dictionary #key #exists
ADD COMMENT
Topic
Name
3+7 =