title: Simple Way to Check Each List Element for Match with Particular String in Python
body: <p>I have the following list in Python:</p>
  <pre><code>my_list = [&quot;yes&quot;, &quot;yes&quot;, &quot;no&quot;, &quot;yes&quot;, &quot;no&quot;, &quot;yes&quot;]
  </code></pre>
  <p>I want to return a list of logical values, being <code>True</code> in case the corresponding list element in my_list is equal to &quot;yes&quot; and <code>False</code> in case the corresponding list element in my_list is equal to &quot;no&quot;.</p>
  <p>Desired output:</p>
  <pre><code>my_list_logical = [True, True, False, True, False, True]
  </code></pre>
  <p>I'm usually programming in R, and in R this could be done easily with the following code:</p>
  <pre><code>my_list == &quot;yes&quot;
  </code></pre>
  <p>I found a Python solution in <a href="https://stackoverflow.com/questions/16685384/finding-the-indices-of-matching-elements-in-list-in-python">this thread</a>. However, the solution of this thread is very complicated, and I cannot believe that this is so much more complicated in Python than in R.</p>
  <p>Is there a simple way on how to return a list of logicals based on my input vector?</p>