Saturday, November 16, 2024
Google search engine
HomeLanguagesSymPy | Subset.rank_lexicographic() in Python

SymPy | Subset.rank_lexicographic() in Python

Subset.rank_lexicographic() : rank_lexicographic() is a sympy Python library function that returns the lexicographic ranking of the subset.

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

Return :
the lexicographic ranking of the subset.

Code #1 : rank_lexicographic() Example




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


Output :

Subset a rank_lexicographic : 14

Code #2 : rank_lexicographic() Example




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


Output :

Subset a rank_lexicographic : 19

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments