Open In App
Related Articles

SymPy | Subset.next_binary() in Python

Improve Article
Improve
Save Article
Save
Like Article
Like

Subset.next_binary() : next_binary() is a sympy Python library function that returns the next binary ordered subset.

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

Return :
the next binary ordered subset

Code #1 : next_binary() Example




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


Output :

Subset a next_binary : [‘for’]

Code #2 : next_binary() Example




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


Output :

Subset a next_binary : [’23’]


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!

Last Updated : 26 Aug, 2019
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials