If I have my_list = [0, 1, 2]. I want to figure out how many possible list partitions there are for a list of length $n$. For the above example, there would be:
[[0, 1, 2]]
[[0, 1], [2]]
[[0], [1, 2]]
[[0], [1], [2]]
If I have my_list = [0, 1, 2]. I want to figure out how many possible list partitions there are for a list of length $n$. For the above example, there would be:
[[0, 1, 2]]
[[0, 1], [2]]
[[0], [1, 2]]
[[0], [1], [2]]
If your list has length $n$, there are $n-1$ places to put a divider between elements. Each choice of a set of dividers makes a different partition. As each divider can be there or not, there are $2^{n-1}$ ways to partition the list. In your example $n=3$ and $2^{3-1}=4$, which is the number of partitions you have found.