0
Q:

how to check if var exists python

# for local
if 'myVar' in locals():
  # myVar exists.
# for globals
if 'myVar' in globals():
  # myVar exists.
3

New to Communities?

Join the community