listtools.cumulative_products — Abjad v1.1.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »

# listtools.cumulative_products

`abjad.tools.listtools.` `cumulative_products`(l)

  Return a list of the cumulative products of the elements in l.

      abjad> listtools.cumulative_products([1, 2, 3, 4, 5, 6, 7, 8])
      [1, 2, 6, 24, 120, 720, 5040, 40320]

      abjad> listtools.cumulative_products([1, -2, 3, -4, 5, -6, 7, -8])
      [1, -2, -6, 24, 120, -720, -5040, 40320]

  Raise `TypeError` when l is neither list nor tuple:

      abjad> mathtools.cumulative_products('foo')
      TypeError

  Raise `ValueError` when l is empty:

      abjad> listtools.cumulative_products([ ])
      ValueError

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »