ExamVeda
Login
Home
41
Which of the following functions cannot be used on heterogeneous sets?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
42
The following Python code results in an error.
s={2, 3, 4, [5, 6]}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
43
Which of the following is not the correct syntax for creating a set?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
44
What will be the output of the following Python code?
>>> a={5,6,7,8}
>>> b={7,5,6,8}
>>> a==b
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
What is the output of the following code:
set1 = {1, 2, 3}
set2 = {2, 3, 4}
print(set1.difference(set2))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
46
In Python, how can you check if a set is a subset of another set?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
47
What will be the output of the following Python code?
s1={1, 2, 3}
s2={4, 5, 6}
s1.isdisjoint(s2)
s2.isdisjoint(s1)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
48
What will be the output of the following Python code?
>>> a={1,2,3}
>>> b=a.copy()
>>> b.add(4)
>>> a
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
49
What will be the output of the following Python code?
s=set()
type(s)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
50
What will be the output of the following code:
my_set = {1, 2, 3}
new_set = my_set.copy()
print(new_set)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board