Vidyalelo
Python · Q133

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 133

Q133

What is the list comprehension equivalent for? x : x is a whole number less than 20, x is even (including zero)

A.
[x for x in range(1, 20) if (x%2==0)]
B.
[x for x in range(0, 20) if (x//2==0)]
C.
[x for x in range(1, 20) if (x//2==0)]
D.
[x for x in range(0, 20) if (x%2==0)]
Answer

Answer: Option D

Solution

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