title: Accessing elements from a Python list using Boolean indexing
body: <p>I recently came across this way of indexing a list in Python. I've never seen this one before, so I would like to understand this clearly.</p>
  <p>I have a list <code>[&quot;Peter&quot;, &quot;James&quot;, &quot;Mark&quot;]</code> and if I index it using the boolean value <code>False</code> it returns <code>Peter</code> and if I index it using <code>True</code> it returns <code>James</code>, as given below</p>
  <ul>
  <li><code>[&quot;Peter&quot;, &quot;James&quot;, &quot;Mark&quot;][False] =&gt; Peter</code></li>
  <li><code>[&quot;Peter&quot;, &quot;James&quot;, &quot;Mark&quot;][True] =&gt; James</code></li>
  </ul>
  <p>I would like to know what happens here and what is this method called as?</p>