Python: Creating map with 2 lists
<p>I want to create map data from 2 list data. I have a simple example like below. What I want to do is create 'new_map' data like below. If it contains specific data, the value should be True.</p>

<pre><code>all_s = ['s1', 's2', 's3', 's4']
data = ['s2', 's4']
new_map = {'s1': False, 's2': True, 's3': False, 's4': True}
</code></pre>

<p>Are there any smart way (like lambda) to implement this? My python env is 3.X. 
Of course I can resolve this problem if I use for-iter simply. But I wonder there are better ways.</p>

<p>This should do it quickly and efficiently in a pythonic manner:</p>

<pre><code> data_set = set(data)
 new_map = {k: k in data_set for k in all_s}
</code></pre>

python python-3.x