Programming and Problem Solving through Python : Sequence data types in python

यदि हमारे पास दो सेट हैं, s1 और s2, और हम यह चेक करना चाहते हैं कि s1 के सभी एलिमेंट s2 में मौजूद हैं या नहीं, हम फ़ंक्शन का यूज़ कर सकते हैं: , If we have two sets, s1 and s2, and we want to check if all the elements of s1 are present in s2 or not, we can use the function:

If we have two sets, s1 and s2, and we want to check if all the elements of s1 are present in s2 or not, we can use the function:




Solution
B. s2.issuperset(s1)



Explanation
Since we are checking whether all the elements present in the set s1 are present in the set s2. This means that s1 is the subset and s1 is the superset. Hence the function to be used is: s2.issuperset(s1). This operation can also be performed by the function: s1.issubset(s2).
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Exam Quiz Website development Company in Allahabad