With the help of
Python3 1=1
Output :
Python3 1=1
sympy.combinatorics.Subset().cardinality method, we can find the total cardinality of subsets by using sympy.combinatorics.Subset().cardinality method.
Syntax : sympy.combinatorics.Subset().cardinality
Return : Return the total cardinality of subset.
Example #1 :
In this example we can see that by using sympy.combinatorics.Subset().cardinality method, we are able to get the total cardinality of subset.
# import sympy and subset
from sympy.combinatorics.subsets import Subset
# Using sympy.combinatorics.Subset().cardinality method
gfg = Subset(['c', 'e'], ['a', 'b', 'c', 'e'])
print(gfg.cardinality)
16Example #2 :
# import sympy and subset
from sympy.combinatorics.subsets import Subset
# Using sympy.combinatorics.Subset().cardinality method
gfg = Subset(['c', 'e', 'f'], ['a', 'f', 'c', 'e'])
print(gfg.cardinality)
Output :
16