ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 16 May 2022 14:30:00 +0200listing all those pairs of tuples which are permutations of each otherhttps://ask.sagemath.org/question/62464/listing-all-those-pairs-of-tuples-which-are-permutations-of-each-other/Suppose I have a list of tuples like
import itertools
l=range(0,6)
m=itertools.combinations(l,2)
list(m)
How do I get those pairs of tuples `(i,j);(x,y)` such that `(i,j)=(y,x)`? Also, is there a way to generalize this, that is, I would to have pairs of tuples `(a,b,c,...);(x,y,z...)` such that `(a,b,c...)=(z,y,x...)`. Is there any efficent way of doing this? Thanks beforehand.vidyarthiMon, 16 May 2022 14:30:00 +0200https://ask.sagemath.org/question/62464/