UPDATED:
In python, how do i split a list into sub-lists based on index ranges
e.g. original list:
list1 = [x,y,z,a,b,c,d,e,f,g]
Note that you can use a variable in a slice:
l = ['a',' b',' c',' d',' e'] c_index = l.index("c") l2 = l[:c_index]
This would put the first two entries of l in l2