python one line return value if availab if not return None
<p>Lets say I have a variable <code>name = "Jack"</code>. I can check it like this</p>

<pre><code>if name:
    return name
else:
    name = None
    return name
</code></pre>

<p>Is there any way to handle it in one line like:</p>

<p><code>new_name = name if not return none</code> 
Which simply return the variable value if available and if not then it should return <code>None</code></p>