DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
7+2 =
Submit