Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python json check if key exist

if 'to' not in data:
    raise ValueError("No target in given data")
if 'data' not in data['to']:
    raise ValueError("No data for target")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #json #check #key #exist
ADD COMMENT
Topic
Name
3+8 =