Friday, November 21, 2025
HomeLanguagesSymPy | Prufer.prev() in Python

SymPy | Prufer.prev() in Python

Prufer.prev() : prev() is a sympy Python library function that returns the Prufer sequence that is delta before the current one.

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

Return :
Prufer sequence that is delta before the current one

Code #1 : prev() Example




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


Output :

Prufer a prev : Prufer([1, 2, 4])

Code #2 : prev() Example




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


Output :

Prufer b prev : Prufer([1, 2, 3, 2, 4, 4])

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

Most Popular

Dominic
32407 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6783 POSTS0 COMMENTS
Nicole Veronica
11929 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11999 POSTS0 COMMENTS
Shaida Kate Naidoo
6907 POSTS0 COMMENTS
Ted Musemwa
7168 POSTS0 COMMENTS
Thapelo Manthata
6863 POSTS0 COMMENTS
Umr Jansen
6847 POSTS0 COMMENTS