Python | sympy.combinatorics.Subset().cardinality method
Last Updated :
28 Aug, 2019
With the help of 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.
from sympy.combinatorics.subsets import Subset
gfg = Subset([ 'c' , 'e' ], [ 'a' , 'b' , 'c' , 'e' ])
print (gfg.cardinality)
|
Output :
16
Example #2 :
from sympy.combinatorics.subsets import Subset
gfg = Subset([ 'c' , 'e' , 'f' ], [ 'a' , 'f' , 'c' , 'e' ])
print (gfg.cardinality)
|
Output :
16
Share your thoughts in the comments
Please Login to comment...