Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python check if value is undefined

try:
    thevariable
except NameError:
    print("well, it WASN'T defined after all!")
else:
    print("sure, it was defined.")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #check #undefined
ADD COMMENT
Topic
Name
1+7 =