Open In App
Related Articles

SymPy | Prufer.prev() in Python

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
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])

Don't miss your chance to ride the wave of the data revolution! Every industry is scaling new heights by tapping into the power of data. Sharpen your skills and become a part of the hottest trend in the 21st century.

Dive into the future of technology - explore the Complete Machine Learning and Data Science Program by GeeksforGeeks and stay ahead of the curve.


Last Updated : 26 Aug, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials