Testing whether a value is in a set and assigning variable
<p>Given this set and an input GET parameter that indicates a chosen fruit</p>

<pre><code>fruit = {'apple', 'banana', 'orange', 'pear'}
</code></pre>

<p>Is there a compact way to do this in one line in python?</p>

<pre><code>chosen = request_obj.get('fruit', '')

if chosen not in fruit:
    chosen = ''
</code></pre>
