Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Itertools permutations()

I know it should be a Python question, but as there is a way to call itertools in Sagemath I ask the question here. According to the documentation

import itertools as it
l1=[1,2,3]
l2=list(it.permutations(l1,2))
l2

should work. But in fact it returns an error. To the opposit

import itertools as it
l1=[1,2,3]
l2=list(it.permutations(l1))
l2

works correctly. Is it a know problem

Itertools permutations()

I know it should be a Python question, but as there is a way to call itertools in Sagemath I ask the question here. According to the documentation

import itertools as it
l1=[1,2,3]
l2=list(it.permutations(l1,2))
l2

should work. But in fact it returns an error. To the opposit

import itertools as it
l1=[1,2,3]
l2=list(it.permutations(l1))
l2

works correctly. Is it a know problemproblem ?