Please see my question at https://ask.sagemath.org/question/80811/removing-certain-entries-from-a-list-of-combinations/
Just now noticed that the two codes are not giving complete list. If we run, for example , the second code, for(say), n=6 and m=4, then we get the output as [[0, 1, 2, 5], [0, 1, 3, 5]]. It should also include [0,1,3,4].