# 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.

 `# 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) `

Output :

16

Example #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

Article Tags :
Practice Tags :