> >>> list(combinations_with_replacement('01',3)) > ('0', '0', '0') > ('0', '0', '1') > ('0', '1', '1') > ('1', '1', '1') > > Is it possible to get combinations_with_replacement to return numbers > rather than strings? (see above) >
>>> list(combinations_with_replacement(range(0,2), 3)) [(0, 0, 0), (0, 0, 1), (0, 1, 1), (1, 1, 1)] Hopefully that'll give you some ideas. Cheers, Xav
-- http://mail.python.org/mailman/listinfo/python-list