Saturday, January 17, 2026
HomeLanguagesSymPy | Prufer.rank() in Python

SymPy | Prufer.rank() in Python

Prufer.rank() : rank() is a sympy Python library function that returns the rank of the Prufer sequence.

Syntax :
sympy.combinatorics.Prufer.prufer.rank()

Return :
rank of the Prufer sequence

Code #1 : rank() Example




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


Output :

Prufer a rank : 38

Code #2 : rank() Example




# Python code explaining
# SymPy.Prufer.rank()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.prufer import Prufer
  
# Using from 
# sympy.combinatorics.prufer.Prufer.rank()
  
# Creating Prufer
b = Prufer([1, 2, 3, 2, 4, 5], [6, 7], [8])
  
# rank value
print ("Prufer b rank : ", b.rank)


Output :

Prufer b rank : 42661

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

Most Popular

Dominic
32474 POSTS0 COMMENTS
Milvus
118 POSTS0 COMMENTS
Nango Kala
6846 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12063 POSTS0 COMMENTS
Shaida Kate Naidoo
6985 POSTS0 COMMENTS
Ted Musemwa
7219 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6911 POSTS0 COMMENTS