On Thursday, August 14, 2014 4:47:42 AM UTC-7, jori.ma...@uta.fi wrote:
>
> To get for example all bit vectors of size 3 one can say 
>
> CartesianProduct(range(2), range(2), range(2)).list() 
>
>
If you want to generate a list of arguments that have to be passed as 
separate arguments, you can use in python:

CartesianProduct( * [range(2) for i in range(3)] )

(Note the star).

As Vincent points out, there are also alternative constructions, such as 
"cartesian_product", which return more intricately wrapped results. It 
depends on your applications if that is useful.
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to