Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add key if not exists python

# credit to Stack Overflow user in the source link
# d is your dictionary

if key not in d:
    d[key] = value
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #key #exists #python
ADD COMMENT
Topic
Name
5+9 =