Python one-liner if else statement
<p>This problem is taken from codingbat. Given two int values, return their sum. Unless the two values are the same, then return double their sum.</p>

<p>I'm trying to solve it in one line:</p>

<pre><code>def sum_double(a, b):
    return 2*(a+b) if (a == b) else return a+b
</code></pre>

<p>But I'm getting an error and I'm not sure why. Would appreciate any help.</p>