index list comprehension python code example
Example 1: python list comprehension index, value
list2 = [x for ind, x in enumerate(list1) if 4 > ind > 0]
Example 2: list comprehension
[expr for val1 in collection1 and val2 collection2 if(condition)]