Computer >> Computer tutorials >  >> Programming >> Python

How to take the first N items from a generator or list in Python?


Slice operator available for Python sequence data types can be easily used to fetch first 5 element from a given list


This below link is tutorial on how to get the first N items from a list in Python, hope you will like it as it contains easy examples. I found this site very useful to learn coding easily