I need to walk through a list in Python, for example:
l = [2313, 1221, 1333, 66, 0, 0, 0, 0]
I would like if the current and next element in the list are equal to zero replaces the current element and the next element by 1.
Or if the current and the previous element are zero: replaces the current and previous element with 1.
How could I do this?