set 3
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> A={1,2,3,4,5,6}
>>> B={1,2,3,4,5,6,7,8,9}
>>> A.issubset(B)
True
>>> A.issuperset(B)
False
>>> B.issuperset(A)
True
>>> B.issubset(A)
False
>>> A.clear()
>>> A
set()
>>> B
{1, 2, 3, 4, 5, 6, 7, 8, 9}
>>> B.clear()
>>> B
set()
>>> ##above was concept to clear all elements in a set
>>> ##subset is small superset is large**
Comments
Post a Comment