31
What is the purpose of the issuperset() method for sets?
Answer & Solution
Answer: Option
A
32
Is the following Python code valid?
>>> a=frozenset([5,6,7])
>>> a
>>> a.add(5)
Answer & Solution
Answer: Option
B
33
What will be the output of the following Python code?
s1={1, 2, 3, 8}
s2={3, 4, 5, 6}
s1|s2
s1.union(s2)
Answer & Solution
Answer: Option
D
34
Which of these about a set is not true?
Answer & Solution
Answer: Option
D
35
What will be the output of the following Python code?
a=set('abc')
b=set('def')
b.intersection_update(a)
a
b
Answer & Solution
Answer: Option
C
36
What is the purpose of the intersection() method for sets?
Answer & Solution
Answer: Option
A
37
What will be the output of the following Python code?
>>> a={1,2,3}
>>> b=a
>>> b.remove(3)
>>> a
Answer & Solution
Answer: Option
C
38
The . . . . . . . . function removes the first element of a set and the last element of a list.
Answer & Solution
Answer: Option
B
39
What will be the output of the following Python code?
>>> a={4,5,6}
>>> b={2,8,6}
>>> a+b
Answer & Solution
Answer: Option
C
40
Which of the following lines of code will result in an error?
Answer & Solution
Answer: Option
D