<br><br><div class="gmail_quote">2010/7/28 Dave Angel <span dir="ltr">&lt;<a href="mailto:davea@ieee.org">davea@ieee.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
<br>
ZUXOXUS wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Oh, I think i got it:<br>
<br>
  <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

for prod in itertools.product(&#39;ABC&#39;, &#39;ABC&#39;):<br>
        <br>
</blockquote></blockquote></blockquote>
print(prod)<br>
<br>
(&#39;A&#39;, &#39;A&#39;)<br>
(&#39;A&#39;, &#39;B&#39;)<br>
(&#39;A&#39;, &#39;C&#39;)<br>
(&#39;B&#39;, &#39;A&#39;)<br>
(&#39;B&#39;, &#39;B&#39;)<br>
(&#39;B&#39;, &#39;C&#39;)<br>
(&#39;C&#39;, &#39;A&#39;)<br>
(&#39;C&#39;, &#39;B&#39;)<br>
(&#39;C&#39;, &#39;C&#39;)<br>
<br>
Thank you very much!!<br>
<br>
2010/7/28 ZUXOXUS &lt;<a href="mailto:zuxoxus@gmail.com" target="_blank">zuxoxus@gmail.com</a>&gt;<br>
  <br>
</blockquote></div>
You&#39;re top-posting, which loses all the context. In this forum, put your comments after whatever lines you&#39;re quoting.<br>
<br>
Your latest version gets the product of two.  But if you want an arbitrary number, instead of repeating the iterable (&#39;ABC&#39; in your case), you can use a repeat count.  That&#39;s presumably what you were trying to do in your earlier incantation.  But you forgot the &#39;repeat&#39; keyword:<br>

<br>
for prod in itertools.product(&#39;ABC&#39;, repeat=4):<br>
   xxxx<br>
<br>
will give you all the four-tuples.<br>
<br>
DaveA<br>
<br>
<br>
</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hey<br></blockquote><div><br></div><div>Sorry for the top-posting, I forgot this rule </div>
</div><br><div>Thanks for the reminder, Dave Angel, and for the &#39;repeat&#39; keyword!</div>