📜  SymPy | Python中的 Prufer.prev()

📅  最后修改于: 2022-05-13 01:54:59.693000             🧑  作者: Mango

SymPy | Python中的 Prufer.prev()

Prufer.prev() :prev()是一个 sympy Python库函数,它返回 Prufer 序列,它是当前序列之前的 delta。

代码 #1:prev() 示例

# 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))

输出 :

代码 #2:prev() 示例

# 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))

输出 :