Useful Python functions
-
sublist.py
Return a sublist of a list according to the index and number of elements (ideal for range pagination)
full_list = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15] index = 2 quantity = 7 sublist(full_list, index, quantity) [6, 7, 8, 9, 10, 11, 12]