21. What will be the output of the following Python code?
>>> s={5,6}
>>> s*3
>>> s={5,6}
>>> s*3
22. In Python, how can you check if two sets have no elements in common?
23. What will be the output of the following Python code?
s={4>3, 0, 3-3}
all(s)
any(s)
s={4>3, 0, 3-3}
all(s)
any(s)
24. What will be the output of the following Python code snippet?
z=set('abc')
z.add('xyz')
z.update(set(['p', 'q']))
z
z=set('abc')
z.add('xyz')
z.update(set(['p', 'q']))
z
25. What will be the output of the following Python code?
>>> a={5,6,7}
>>> sum(a,5)
>>> a={5,6,7}
>>> sum(a,5)
26. What will be the output of the following Python code?
x=set('abcde')
y=set('xyzbd')
x.difference_update(y)
x
y
x=set('abcde')
y=set('xyzbd')
x.difference_update(y)
x
y
27. What will be the output of the following Python code?
>>> a={1,2,3}
>>> b=frozenset([3,4,5])
>>> a-b
>>> a={1,2,3}
>>> b=frozenset([3,4,5])
>>> a-b
28. What will be the output of the following Python code?
>>> a={1,2,3}
>>> a.intersection_update({2,3,4,5})
>>> a
>>> a={1,2,3}
>>> a.intersection_update({2,3,4,5})
>>> a
29. In Python, how can you check if two sets have no elements in common?
30. What will be the output of the following Python code snippet?
l=[1, 2, 4, 5, 2, 'xy', 4]
set(l)
l
l=[1, 2, 4, 5, 2, 'xy', 4]
set(l)
l