I want to check if a variable exists. Now I’m doing something like this:

try:
    myVar
except NameError:
    # Do something.

Are there other ways without exceptions?

1
14

Leave a Reply

Your email address will not be published. Required fields are marked *