set : set to checked
A={'x','y','z','a','b','c'}
B={'x','y','z'}
print(B.issubset(A))
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='Welcome to Python'
print(A.issubset(B))
Outut ( here all elements of A is present in B )
True
A={'x','y'}
B=['a','b','x','y']
print(A.issubset(B))
Output
True
All set methods Questions with solutions on set
isdisjoint()
issuperset()
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.