Question 5

Last Updated :
Discuss
Comments

What is the output of this list comprehension?

Python
res = [x for x in range(5) if x % 2 == 0]
print(res)


[1, 3, 5]

[0, 2, 4]

[0, 1, 2, 3, 4]

[2, 4]

Share your thoughts in the comments