ExamVeda
Login
Home
11
What is the output of the following code:
my_set = {1, 2, 3, 4, 5}
my_set.pop()
print(my_set)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
12
What is the output of the following code:
my_set = {1, 2, 3}
my_set.remove(2)
print(my_set)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
13
Which method is used to find the intersection of two sets?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
14
What is the output of the following code:
set1 = {1, 2, 3}
set2 = {1, 2}
print(set1.issuperset(set2))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
15
What will be the output of the following Python code snippet?
a=[1, 4, 3, 5, 2]
b=[3, 1, 5, 2, 4]
a==b
set(a)==set(b)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
16
What will be the output of the following Python code snippet?
s=set([1, 2, 3])
s.union([4, 5])
s|([4, 5])
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
17
What will be the output of the following Python code?
>>> a={3,4,5}
>>> a.update([1,2,3])
>>> a
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
18
What is the purpose of the clear() method for sets?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
19
What will be the output of the following Python code?
>>> a={5,6,7,8}
>>> b={7,8,9,10}
>>> len(a+b)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
20
If a={5,6,7,8}, which of the following statements is false?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board