Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

SymPy | Subset.rank_binary() in Python

  • Last Updated : 28 Aug, 2019

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!