Related Articles
Python | SymPy Permutation.full_cyclic_form() method
• Last Updated : 27 Aug, 2019

Permutation.full_cyclic_form() : full_cyclic_form() is a sympy Python library function that returns the permutation in cyclic form, by including the singletons.

Syntax :
sympy.combinatorics.permutations.Permutation.full_cyclic_form()

Return :
permutation in cyclic form

Code #1 : full_cyclic_form() Example

 `# Python code explaining``# SymPy.Permutation.full_cyclic_form()`` ` `# importing SymPy libraries``from` `sympy.combinatorics.partitions ``import` `Partition``from` `sympy.combinatorics.permutations ``import` `Permutation`` ` `# Using from sympy.combinatorics.permutations.Permutation.full_cyclic_form() method `` ` `# creating Permutation``a ``=` `Permutation([``2``, ``0``, ``3``, ``1``, ``5``, ``4``])`` ` `b ``=` `Permutation([``3``, ``1``, ``2``, ``5``, ``4``, ``0``])`` ` ` ` `print` `(``"Permutation a - full_cyclic_form form : "``, a.full_cyclic_form)``print` `(``"Permutation b - full_cyclic_form form : "``, b.full_cyclic_form)`

Output :

Permutation a – full_cyclic_form form : [[0, 2, 3, 1], [4, 5]]
Permutation b – full_cyclic_form form : [[0, 3, 5], [1], [2], [4]]

Code #2 : full_cyclic_form() Example – 2D Permutation

 `# Python code explaining``# SymPy.Permutation.full_cyclic_form()`` ` `# importing SymPy libraries``from` `sympy.combinatorics.partitions ``import` `Partition``from` `sympy.combinatorics.permutations ``import` `Permutation`` ` `# Using from ``# sympy.combinatorics.permutations.Permutation.full_cyclic_form() method `` ` `# creating Permutation``a ``=` `Permutation([[``2``, ``4``, ``0``], ``                 ``[``3``, ``1``, ``2``],``                 ``[``1``, ``5``, ``6``]])``     ` `print` `(``"Permutation a - full_cyclic_form form : "``, a.full_cyclic_form)`

Output :

Permutation a – full_cyclic_form form : [[0, 3, 5, 6, 1, 2, 4]]

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up