Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 431 Bytes

README.md

File metadata and controls

9 lines (6 loc) · 431 Bytes

Split a list in Python

Usually I need to split lists in Python. Because there is not a method to do this, I wrote a code to solve this iussue.

I wrote list subclass method and I called this method split_list. For instance, if I have a huge amount of elements in this list, I can split this list in n sub-lists. I must write the number of chunks as argument of method. The method returns a list containing the asked chunks.