I have a function in python that checks if the value of listy_poo[0] is a certain value. If it is, I need to skip index 1 and get the value of index 2.
My code:
def find():
i = 0
for e in listy_poo:
if listy_poo[i] == 'value':
print(listy_poo[i+2])
i += 1
Clearly wrong, but is there something in python that accomplishes what I'm attempting?
UPDATE:
I thought the problem was the syntax of listy_poo[i+2] but looking over the history has shown that I actually didn't save my change from when I attempted listy_poo[i]+2, which is wrong. Thanks for your help anyway, folks.
1stelement as well (The logic that you perform for element with index 2 onwards)?