issuperset() method for set

All set methods

issuperset(set) takes one set ( any iterable ) as argument .

set : set to checked
While checking we can use iterable objects like string , list etc Returns : True or False
issubset True
A={'x','y','z','a','b','c'}
B={'x','y','z'}
print(A.issuperset(B))
Output ( All elements of B is present in inside A )
True
isdisjoint False
A={'x','y','z','a','b','c'}
B={'x','y','z','k','l','m'}
print(B.issubset(A))
Output ( There are elements in B which are not in A )
False

Using stirng

String is an iterable objects
A={'y','t','W','o','e'}
B='We'
print(A.issuperset(B))
Outut ( here all elements of B is present in A )
True

Using list

List is an iterable objects
A={'x','y','a','b'}
B=['a','b']
print(A.issuperset(B))
Output ( all elements of B is present inside A )
True
All set methods Questions with solutions on set isdisjoint() issubset()
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer