title: Is it possible only to declare a variable without assigning any value in Python?
body: <p>Is it possible to declare a variable in Python, like so?:</p>
  <pre><code>var
  </code></pre>
  <p>so that it initialized to None? It seems like Python allows this, but as soon as you access it, it crashes. Is this possible? If not, why?</p>
  <p>EDIT: I want to do this for cases like this:</p>
  <pre><code>value
  
  for index in sequence:
  
     if value == None and conditionMet:
         value = index
         break
  </code></pre>
  <h3>Related Questions</h3>
  <ul>
  <li><a href="https://stackoverflow.com/questions/575196/">Why can a function modify some arguments as perceived by the caller, but not others?</a></li>
  <li><a href="https://stackoverflow.com/questions/11007627/">Python Variable Declaration</a></li>
  </ul>
  <h3>See Also</h3>
  <ul>
  <li><a href="https://nedbatchelder.com/text/names1.html" rel="noreferrer">Python Names and Values</a></li>
  <li><a href="http://python.net/%7Egoodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables" rel="noreferrer">Other languages have &quot;variables&quot;</a></li>
  </ul>