operations on lists while unpacking
<p>I have a list of strings:</p>

<pre><code>my_list = ['text_1','ibno0d',' text_2 ' ]
</code></pre>

<p>And I want to save the first and third value in new variables:</p>

<p>a,_,b = my_list</p>

<p>Since text_1 and text_2 have some spaces I use strip method to clean those values.</p>

<pre><code>a = a.strip()
b = b.strip()
</code></pre>

<p>I want to do this a the moment of the assignment, what I thought to do is:</p>

<pre><code>my_list = [' text_1','ibno0d',' text_2 ' ]
a,_,b  = [text.strip() for text in my_list]
</code></pre>

<p>is there a better option to acomplish this?</p>

<p>I prefer using <code>map</code> for this..</p>

<pre><code>a, _, b = map(str.strip, my_list)
</code></pre>

python list