How to iterate through a list in Python without using a "for" loop?
<p>I want to print all the elements in the <em>range</em> from 2 to 8 then use <strong>for</strong> loop:</p>
<p>E.g:</p>
<pre><code>for i in range(2,8):
    print(i)
</code></pre>
<p>What is the best method to iterate without using a <strong>for</strong>, or <strong>while</strong> loop, which reduces the <em>time complexity</em>?</p>