an> <span class="c1"># select from index 5 up to 2 elements before the end</span>
</pre></div>
</div>
</section>
<section id="selection-based-on-logic">
<h3><a class="toc-backref" href="#id14" role="doc-backlink">Selection Based on Logic</a><a class="headerlink" href="#selection-based-on-logic" title="Link to this heading">¶</a></h3>
<p>You can use functions that return logical values to select</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">