How to test a variable is null in python : <pre><code>val = ""

del val

if val is None:
    print("null")
</code></pre>

<p>I ran above code, but got <code>NameError: name 'val' is not defined</code>.</p>

<p>How to decide whether a variable is null, and avoid NameError?</p>
