I have a position list 2,7,11,15 and i want to through them and to find the range value of every first index value and second index value. Imagine the 2 is the start and 7 is the end and then continue 7 become the start and 11 become the end. i want to get the range of between 2 and 7 and then 7 to 11 and 11 to 15.
what i did :
position[2,7,11,15]
for index, line in enumerate(position):
length = range(position[index],position[index+1])
for n in length:
print(n)