set
: set to checked 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
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
A={'y','t','W','o','e'}
B='We'
print(A.issuperset(B))
Outut ( here all elements of B is present in A )
True
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()
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.