Say I\'ve got a list and I want to iterate over the first n of them. What\'s the best way to write this in Python?
n
I'd probably use itertools.islice (<- follow the link for the docs), which has the benefit of working with any iterable object.