List multiplication

Posted by Schitti on Stack Overflow See other posts from Stack Overflow or by Schitti
Published on 2010-01-30T23:03:37Z Indexed on 2010/05/15 9:04 UTC
Read the original article Hit count: 283

Filed under:
|
|

Hi, Python newbie here.

I have a list L = [a, b, c] and I want to generate a list of tuples :

[(a,a), (a,b), (a,c), (b,a), (b,b), (b,c)...] 

I tried doing L * L but it didn't work. Can someone tell me how to get this in python.

© Stack Overflow or respective owner

Related posts about python

Related posts about list