How to iterate over the first n elements of a list?

Posted by Bialecki on Stack Overflow See other posts from Stack Overflow or by Bialecki
Published on 2010-04-22T03:37:14Z Indexed on 2010/04/22 3:43 UTC
Read the original article Hit count: 211

Filed under:

Say I want I've got a list and I want to iterate over the first n of them. What's the most concise way to write this in Python?

© Stack Overflow or respective owner

Related posts about python