# SymPy | Subset.subset_indices() in Python

Subset.subset_indices() : subset_indices() is a sympy Python library function that returns the indices of subset in superset in a list

Syntax :
sympy.combinatorics.subset.Subset.subset_indices()

Return :
the indices of subset in superset in a list
if all elements of subset are not in superset. – list is empty

Code #1 : subset_indices() Example

 `# Python code explaining ` `# SymPy.Subset.subset_indices() ` ` `  `# importing SymPy libraries ` `from` `sympy.combinatorics ``import` `Permutation, Cycle ` `from` `sympy.combinatorics.subsets ``import` `Subset ` ` `  `# Using from  ` `# sympy.combinatorics.subset.Subsets.subset_indices() ` ` `  `# superset ` `super_set ``=` `[``4``, ``3``, ``2``, ``7``] ` ` `  `# Creating Subset ` `a ``=` `Subset.subset_indices(([``'geek'``, ``'for'``, ``'c'``, ``'d'``]), super_set) ` ` `  `# subset_indices value ` `print` `(``"Subset a subset_indices : "``, a) `

Output :

Subset a subset_indices : []

Code #2 : subset_indices() Example

 `# Python code explaining ` `# SymPy.Subset.subset_indices() ` ` `  `# importing SymPy libraries ` `from` `sympy.combinatorics ``import` `Permutation, Cycle ` `from` `sympy.combinatorics.subsets ``import` `Subset ` ` `  `# Using from  ` `# sympy.combinatorics.subset.Subsets.subset_indices() ` ` `  `# superset ` `super_set ``=` `[``4``, ``3``, ``2``, ``7``] ` ` `  `# Creating Subset ` `a ``=` `Subset.subset_indices(([``2``, ``3``, ``4``]), super_set) ` ` `  `# subset_indices value ` `print` `(``"Subset a subset_indices : "``, a) `

Output :

Subset a subset_indices : [2, 1, 0]

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.