What is the best way to set a fallback value in Python?
<p>I've recently found myself using the following pattern a lot:</p>

<pre><code>x = 3
if this:
   this.process()
   if this.something:
       x = this.a_value
</code></pre>

<p>I don't want to do this:</p>

<pre><code>if this and (this.process() or True) and this.someting:
    x = this.a_value
else:
    x = 3
</code></pre>

<p>or this:</p>

<pre><code>if this:
   this.process()
   if this.something:
       x = this.a_value
   else:
       x = 3
else:
    x = 3
</code></pre>

<p>but I can't help but feel that setting the value and then changing it is a little messy, especially considering in some use cases the fallback value is seldom used.</p>

<p>Is there a better/tidier way?</p>
