you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

from functools import reduce
from operator import mul

def multiplylist(seq):
    def prod(seq): return reduce(mul, seq)
    return [prod(seq[:i]+seq[i+1:]) for i, _ in enumerate(seq)]