a = [3,5,8,3,9,5,0,3,2,7,5,4]
for o in a[::3]:
print o
This gets me the first and every 3 item. 3,3,0,7
is there a way i can retrieve the next two items as well?
a = [3,5,8,3,9,5,0,3,2,7,5,4]
for o in a[::3]:
if o == 0:
print o
print o + 1
print o + 2
output 0 3 2
I know that's not correct but maybe you can see what I'm trying to do. Basically, I have a long list of properties and there are three parts to each property, parent_id, property_type and property_value and I need to retrieve all three parts of the property from the list.