How do I properly use a backslash to continue a line in an if statement?
<p>e.g. D, if sum_p is not zero.</p>

<pre><code>D = 1/sum_p if sum_p \
    else 0
</code></pre>

<p>What if I want to return the value? Should I do:</p>

<pre><code>return 1/sum_p if sum_p \
else 0
</code></pre>

<p>or just write</p>

<pre><code>if...
else: return 0
</code></pre>
