Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get a value using a dictionary key in python

print(d.get('key5', 'NO KEY'))
# NO KEY

print(d.get('key5', 100))
# 100
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #dictionary #key #python
ADD COMMENT
Topic
Name
2+4 =