If i have a list (or list of lists) with elements of size k and i want to generate all higher level elements (of size k + 1) from it,what should i do??Any pointers would be of a great help

I tried the following for lists...for list of lists i do not know what to do :((

```
#pruned_k is a list or list of lists
for element in pruned_k:
if len(element)=1: #generate all 2 size sets
for i in range(0,len(pruned_k)-1,2)
pruned_new.append(pruned_k[i:i+2])
else: #if pruned_k is list of lists e.g [['a','b'],['b','c']]
pruned_new.append(
```

Thanks a lot,

girish