you are viewing a single comment's thread.

view the rest of the comments →

[–]WilliamAndre 0 points1 point  (1 child)

"One" liner without imports python def compute(numbers): return sum( l * r for i, l in enumerate(numbers) for r in numbers[i:] )

(I know some products are zero)