This is pretty basic but I was coding and started wondering if there was a pythonic way to check if something does not exist. Here\'s how I do it if its true:
What about the negation?
if not var: print 'nope it does not'
Though this is to see if the var is false / none and would blow up if var is not defined.
To see if var is defined:
try: var except NameError: print 'not defined'