Vidyalelo
Python · Q140

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 140

Q140

Write the list comprehension to pick out only negative integers from a given list 'l'.

A.
[x<0 in l]
B.
[x for x<0 in l]
C.
[x in l for x<0]
D.
[x for x in l if x<0]
Answer

Answer: Option D

Solution

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