How do I check if a Python variable exists?
I can know if a variable is defined or not using exception handling as follows.
try:
my_variable
except NameError as e:
print str(e)
I want to find if a variable in a python code exists or not without using try-except block.