<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
>>> list(combinations_with_replacement('01',3))<br>
('0', '0', '0')<br>
('0', '0', '1')<br>
('0', '1', '1')<br>
('1', '1', '1')<br>
<br>
Is it possible to get combinations_with_replacement to return numbers<br>
rather than strings? (see above)<br></blockquote><div><br><span style="font-family: courier new,monospace;">>>> list(combinations_with_replacement(range(0,2), 3))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[(0, 0, 0), (0, 0, 1), (0, 1, 1), (1, 1, 1)]<br><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">Hopefully that'll give you some ideas.</span><br style="font-family: arial,helvetica,sans-serif;">
<br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">Cheers,</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">Xav</span></span> <br>
</div></div>