ExamVeda
Login
Home
71
Set members must not be hashable.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
72
What will be the output of the following Python code?
a = [5,5,6,7,7,7]
b = set(a)
def test(lst):
    if lst in b:
        return 1
    else:
        return 0
for i in  filter(test, a):
    print(i,end=" ")
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
73
What will be the output of the following code:
set1 = {1, 2, 3}
set2 = {3, 4, 5}
print(set1.intersection(set2))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
74
Which of the following functions will return the symmetric difference between two sets, x and y?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
75
What is the output of the following code:
set1 = {1, 2, 3}
set2 = {3, 4, 5}
print(set1.union(set2))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
76
In Python, how can you create an empty set?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
77
What will be the output of the following Python code?
s1={1, 2, 3}
s2={3, 4, 5, 6}
s1.difference(s2)
s2.difference(s1)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
78
What will be the output of the following Python code?
a={1,2,3}
b={1,2,3}
c=a.issubset(b)
print(c)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
79
What will be the output of the following Python code?
s={1, 2, 3}
s.update(4)
s
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
80
What will be the output of the following Python code?
>>> a={1,2,3}
>>> b=a.add(4)
>>> b
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board