fork(2) download
  1. f = lambda x,y:[n for n in range(1<<x+y)if bin(n).count('1')==y]
  2.  
  3. for (x, y) in (0, 1), (1, 1), (3, 2):
  4. print (x, y), f(x, y)
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
(0, 1) [1]
(1, 1) [1, 2]
(3, 2) [3, 5, 6, 9, 10, 12, 17, 18, 20, 24]