title: In Python, how do I check if a variable exists?
body: <p>If "x" exists, then print "x exists".</p>
  
  <p>I ask this because I always get this error:</p>
  
  <pre><code>UnboundLocalError at /settings/
  local variable 'avatarlink' referenced before assignment
  </code></pre>