def max(self):
        """
        The maximum element moved by the permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([1, 0, 2, 3, 4])
        >>> p.max()
        1

        See Also
        ========

        min, descents, ascents, inversions
        """
        max = 0
        a = self.array_form
        for i in range(len(a)):
            if a[i] != i and max > a[i]:
                max = a[i]
        return max
dataset/ETHPy150Open sympy/sympy/sympy/combinatorics/permutations.py/Permutation.max/swapped operands of `>`