listtools.true_indices — Abjad v1.1.1 documentation

### Navigation

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

# listtools.true_indices

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

  Return the nonnegative integers `i, j, ...` for which `l[i], l[j], ...` are `True`.

      abjad> l = [0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1]
      abjad> listtools.true_indices(l)
      [3, 4, 5, 9, 10, 11]

      abjad> l = [0, 0, 0, 0, 0, 0]
      abjad> listtools.true_indices(l)
      []

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

      abjad> listtools.true_indices('foo')
      TypeError

### Navigation

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