Skip to content

Commit eaaf31e

Browse files
Sanjay_PradeepkumarSanjay_Pradeepkumar
Sanjay_Pradeepkumar
authored and
Sanjay_Pradeepkumar
committed
Addition of issubset() and issuperset()
With explanation
1 parent 57a33d1 commit eaaf31e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

DataCollectionTypes/sets.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,25 @@
148148

149149

150150

151+
# issubset()
152+
153+
s1 = {'a','b','c'}
154+
s2 = {'c','d','e','a','m','b'}
155+
156+
s1.issubset(s2) # --> True [Explanation: checks wether all elements of s1 is available in s2 or not, if available then returns True else False]
157+
158+
s2.issubset(s1) # --> False [Explanation: checks wether all elements of s2 is available in s1 or not, if available then returns True else False]
159+
160+
161+
# issuperset()
162+
163+
s1 = {'a','b','c'}
164+
s2 = {'c','d','e','a','m','b'}
165+
166+
s1.issuperset(s2) # --> False [Explanation: checks whether all elements of s2 is available in s1 or not, if available then returns True else False]
167+
168+
169+
151170

152171

153172

0 commit comments

Comments
 (0)