a = [3,5,8,3,9,5,0,3,2,7,5,4] for o in a[::3]: print o
This gives me the first and every 3 points. 3,3,0,7
Is there a way to get the following two items?
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 this is wrong, 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 extract all three parts of the property from the list.