Tuesday, November 19, 2024
Google search engine
HomeLanguagesSymPy | Subset.superset_size() in Python

SymPy | Subset.superset_size() in Python

Subset.superset_size() : superset_size() is a sympy Python library function that returns the size of the superset.

Syntax :
sympy.combinatorics.subset.Subset.superset_size()

Return :
the size of the superset.

Code #1 : superset_size() Example




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


Output :

Subset a superset_size : 4

Code #2 : superset_size() Example




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


Output :

Subset a superset_size : 5

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