Just declaring a variable in Python?
<p>Is it possible to just declaring a variable in Python, like so?:</p>

<p>var</p>

<p>so that it's gonna be initialized to None?</p>

<p>It seems like python allows this, but as soon as you access it, it crashes.</p>

<p>Is this possible? If not, why?</p>

<p>EDIT: I wanna 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>Duplicate</h3>

<ul>
<li><a href="http://stackoverflow.com/questions/664219/uninitialized-value-in-python">Uninitialised value in python</a> (by same author)</li>
<li><a href="http://stackoverflow.com/questions/571514/are-there-any-declaration-keywords-in-python">Are there any declaration keywords in Python?</a> (by the same author)</li>
</ul>

<h3>Related</h3>

<ul>
<li><a href="http://stackoverflow.com/questions/575196/python-variable-scope-and-function-calls">Python: variable scope and function calls</a></li>
<li><a href="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables" rel="nofollow">Other languages have "variables"</a></li>
</ul>
