Consider two list comprehensions gamma
and delta
with nearly redundant code. The difference being the sliced lists alpha
and beta
, namely
gamma = [alpha[i:i+30] for i in range(0,49980,30)]
delta = [beta[i:i+30] for i in range(0,49980,30)]
Is there a pythonic way to write this as a one liner (say gamma,delta = ...
)?
I have a few other pieces of code that are similar in nature, and I'd like to simplify the code's seeming redundancy.