# SymPy | Subset.rank_binary() in Python

Subset.rank_binary() : rank_binary() is a sympy Python library function that returns the binary ordered rank.

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

Return :
the binary ordered rank.

Code #1 : rank_binary() Example

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

Output :

Subset a rank_binary : 3

Code #2 : rank_binary() Example

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

Output :

Subset a rank_binary : 14

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Previous
Next