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
The normal way would be slicing:
for item in your_list[:n]: ...
1.4m articles
1.4m replys
5 comments
57.0k users