I’m trying to generate an output based on a list of strings, which keeps on giving the same output until it says otherwise, at which point it’ll change around for the rest of the list.
In this case I’m trying to pick out r’s and l’s and switch on the basis of that.
So in this case the output is
…and with that I’d like the output to be
I hope I’m making myself clear.
This is what I got so far:
I have already filtered out the positions of the inputs and got the indices of the l’s and the r’s but I can’t really think of a way to generate the list that I’d like to have.
Thanks in advance!