PYTHON CIRCLE
Practice
Python Books
Archive
Subscribe
Login
Menu
Login
Practice
Python Books
Archive
Subscribe
Blog available for sell
This blog is available for sale. Please 'contact us' if interested.
Advertise with us
Python Multiple Choice Questions
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]
Show Answer
Next Question
Correct Answer:
D
Explanation: 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].
© 2024-2025 Python Circle
Contact
Sponsor
Archive
Sitemap