Wednesday, May 6, 2026
HomeLanguagesSymPy | Prufer.size() in Python

SymPy | Prufer.size() in Python

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

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

Return :
size of the Prufer sequence

Code #1 : size() Example




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


Output :

Prufer a size : 125

Code #2 : size() Example




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


Output :

Prufer b size : 262144

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

Most Popular

Dominic
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6890 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12105 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6962 POSTS0 COMMENTS