Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

check if variable exists python

try:
    myVar
except NameError:
    myVar = None      # or some other default value.

# Now you're free to use myVar without Python complaining.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #variable #exists #python
ADD COMMENT
Topic
Name
9+1 =