Wednesday, November 20, 2024
Google search engine
HomeLanguagesSymPy | Subset.subset_from_bitlist() in Python

SymPy | Subset.subset_from_bitlist() in Python

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]

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments