I want to iterate through a list and sum all the elements. Except, if the number is a 5, I want to skip the number following that 5. So for example:
x=[1,2,3,4,5,6,7,5,4,3] #should results in 30
.
I'm just not sure how I can access the index of a tuple, when I use enumerate. What I want to do, is use an if statement, that if the number at the previous index == 5, continue the loop.
Thanks you