SymPy | Permutation.length() in Python Last Updated : 27 Aug, 2019 Comments Improve Suggest changes Like Article Like Report Permutation.length() : length() is a sympy Python library function that finds the number of integers moved by the permutation. Syntax : sympy.combinatorics.permutations.Permutation.length() Return : number of integers moved by the permutation Code #1 : length() Example Python3 1=1 # Python code explaining # SymPy.Permutation.length() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from sympy.combinatorics.permutations.Permutation.length() method # creating Permutation a = Permutation([[2, 0], [3, 1]]) b = Permutation([1, 3, 5, 4, 2, 0]) print ("Permutation a - length form : ", a.length()) print ("Permutation b - length form : ", b.length()) Output : Permutation a - length form : 4 Permutation b - length form : 6 Code #2 : length() Example - 2D Permutation Python3 1=1 # Python code explaining # SymPy.Permutation.length() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from sympy.combinatorics.permutations.Permutation.length() method # creating Permutation a = Permutation([[2, 4, 0], [3, 1, 2], [1, 5, 6]]) print ("Permutation a - length form : ", a.length()) Output : Permutation a - length form : 7 Comment More infoAdvertise with us Next Article SymPy | Permutation.length() in Python N noobestars101 Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads SymPy | Permutation.list() in Python Permutation.list() : list() is a sympy Python library function that returns the permutation as an explicit list, possibly trimming unmoved elements if size is less than the maximum element in the permutation. Syntax : sympy.combinatorics.permutations.Permutation.list() Return : permutation as an exp 2 min read SymPy | Permutation.next_lex() in Python Permutation.next_lex() : next_lex() is a sympy Python library function that returns the next permutation in lexicographical order and if in case the self is the last permutation in lexicographical order it returns None. Syntax : sympy.combinatorics.permutations.Permutation.next_lex() Return : next p 1 min read SymPy | Permutation.min() in Python Permutation.min() : min() is a sympy Python library function that returns the minimum value in the permutation. Syntax : sympy.combinatorics.permutations.Permutation.min() Return : minimum value in the permutation Code #1 : min() Example Python3 1=1 # Python code explaining # SymPy.Permutation.min() 1 min read SymPy | Permutation.order() in Python Permutation.order() : order() is a sympy Python library function that calculates the order of a permutation. When the permutation is raised to the power of its order, then, in that case, the order equals the identity permutation. Syntax : sympy.combinatorics.permutations.Permutation.order() Return : 1 min read Python | SymPy Permutation.index() method Permutation.index() : index() is a sympy Python library function that returns the index value of the permutation in argument. Index of a permutation = Sum of all subscripts j such that permutation[j] is greater than permutation[j+1]. Syntax : sympy.combinatorics.permutations.Permutation.index() Retu 1 min read Like