📜  SymPy | Python中的 Subset.bitlist_from_subset()

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

SymPy | Python中的 Subset.bitlist_from_subset()

Subset.bitlist_from_subset() :bitlist_from_subset()是一个 sympy Python库函数,它返回对应于子集的位列表。

代码 #1:bitlist_from_subset() 示例

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

输出 :

代码 #2:bitlist_from_subset() 示例

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

输出 :