📜  SymPy | Python中的 Subset.next_binary()

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

SymPy | Python中的 Subset.next_binary()

Subset.next_binary() :next_binary()是一个 sympy Python库函数,它返回下一个二进制有序子集。

代码 #1:next_binary() 示例

# Python code explaining
# SymPy.Subset.next_binary()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
  
# Using from 
# sympy.combinatorics.subset.Subsets.next_binary()
  
# Creating Subset
a = Subset(['c', 'd'], ['geek', 'for', 'c', 'd'])
  
# next_binary value
print ("Subset a next_binary : ", a.next_binary().subset)

输出 :

代码 #2:next_binary() 示例

# Python code explaining
# SymPy.Subset.next_binary()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
  
# Using from 
# sympy.combinatorics.subset.Subsets.next_binary()
  
# Creating Subset
a = Subset(['c', 'd'], ['23', 'c', 'd'])
  
# next_binary value
print ("Subset a next_binary : ", a.next_binary().subset)

输出 :