Python generate custom combinations of sub lists
What could be improved here?


@thnx Peilonrayz, a generator expression will work better on large inputs


Use a nested generator expression.
DON'T hardcode variables, this will make your code very static.
Make a function, to accept different variables.




def custom_combo(L):
    return (L[i] + L[j] for i in range(len(L)) for j in range(i+1, len(L)))

if __name__ == '__main__':
    a = [[1, 2], [2, 3], [4, 3]]
    print(list(custom_combo(a)))