add elements in a list, using 0 as a break
hello!
i am working on a project that generates a series of binary numbers i.e. 1 0 1 1 0
i have collected these into lists
but i wish to export these in the format, using the example above, 1 2
another example just to make it clear would be that the system spits out 1 1 1 0 1, and i would want that to display as 3 1
basically, add adjacent numbers in the list but ignore 0
i'm sure there's a very obvious answer that i'm missing but if anyone can help, it would be massively aprpeciated!
thank you
iter the list, add all == 1 till next zero
then continue till the end of list
zl objects can help you.
so that's the theory that i'm working on
but the question is how to do that in practicality
............................................................
thanks double!
that's exactly the ticket!
My take on it, using [accum]