Vidyalelo
Python · Q72

Python Sets MCQs: Exam

Programming · Python · question 72

Q72

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=" ")

A.
5 5 6
B.
5 6 7
C.
5 5 6 7 7 7
Answer
D.
5 6 7 7 7

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board