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

PythonServer Side ProgrammingProgramming

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

raja
Published on 11-Jan-2018 19:35:37
Advertisements