given
samplelist = [100,101,102,103,104,105,106,107,108,109]
then I want output as below:
[100,[101,102,103,104,105,106,10
use itertools.combinations():
itertools.combinations()
import itertools a = [100,101,102,103,104,105,106,107,108,109] list(itertools.combinations(a, len(a)-1))[::-1]