Thursday, November 20, 2025
HomeLanguagesPython | Sympy partitions.RGS_rank() method

Python | Sympy partitions.RGS_rank() method

With the help of sympy.combinatorics.partitions.RGS_rank() method, we can get the rank of the restricted growth string in sympy.combinatorics.partitions.RGS_rank() method.

Syntax : sympy.combinatorics.partitions.RGS_rank()
Return : Return a rank of restricted growth string.

Example #1 :
In this example we can see that by using sympy.combinatorics.partitions.RGS_rank() method, we are able to get the rank of restricted growth string.




# import sympy and RGS_unrank
from sympy.combinatorics.partitions import RGS_rank
from sympy import * x, y = symbols('x y')
    
# Using sympy.combinatorics.partitions.RGS_rank method
gfg = RGS_rank([1, 2, 5, 4, 2, 10])
  
print(gfg)


Output :

697

Example #2 :




# import sympy and RGS_unrank
from sympy.combinatorics.partitions import RGS_rank
from sympy import * x, y = symbols('x y')
    
# Using sympy.combinatorics.partitions.RGS_rank method
gfg = RGS_rank([2, 1, 5, 1, 0, 7])
  
print(gfg)


Output :

392

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

Most Popular

Dominic
32404 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6775 POSTS0 COMMENTS
Nicole Veronica
11924 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11994 POSTS0 COMMENTS
Shaida Kate Naidoo
6903 POSTS0 COMMENTS
Ted Musemwa
7159 POSTS0 COMMENTS
Thapelo Manthata
6859 POSTS0 COMMENTS
Umr Jansen
6846 POSTS0 COMMENTS