Subset.subset_from_bitlist() : subset_from_bitlist() is a sympy Python library function that returns the subset defined by the bitlist.
Syntax :
sympy.combinatorics.subset.Subset.subset_from_bitlist()Return :
the subset defined by the bitlist
Code #1 : subset_from_bitlist() Example
# Python code explaining # SymPy.Subset.subset_from_bitlist() # importing SymPy libraries from sympy.combinatorics import Permutation, Cycle from sympy.combinatorics.subsets import Subset # Using from # sympy.combinatorics.subset.Subsets.subset_from_bitlist() # Creating Subset a = Subset.subset_from_bitlist( ([ 'geek' , 'for' , 'c' , 'd' ]), '0101' ) # subset_from_bitlist value print ( "Subset a subset_from_bitlist : " , a.subset) |
Output :
Subset a subset_from_bitlist : [‘for’, ‘d’]
Code #2 : subset_from_bitlist() Example
# Python code explaining # SymPy.Subset.subset_from_bitlist() # importing SymPy libraries from sympy.combinatorics import Permutation, Cycle from sympy.combinatorics.subsets import Subset # Using from # sympy.combinatorics.subset.Subsets.subset_from_bitlist() # Creating Subset a = Subset.subset_from_bitlist(([ 2 , 3 , 3 , 4 ]), '1011' ) # subset_from_bitlist value print ( "Subset a subset_from_bitlist : " , a.subset) |
Output :
Subset a subset_from_bitlist : [2, 3, 4]