M

Mr. Dubey • 52.77K Points
Coach

Q. 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]
Share

Explanation by: Mr. Dubey
 to pick out only the negative numbers from a given list ‘l’, the correct list comprehension statement would be: [x for x in l if x<0].

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics