Question 4

Last Updated :
Discuss
Comments

What will the following code return?

Python
a = [1, 2, 2, 3, 4]
res = {x for x in a if x % 2 == 0}
print(res)



[2, 4]

{2, 2, 4}

{2, 4}

(2, 4)

Share your thoughts in the comments