

MCQOPTIONS
Saved Bookmarks
This section includes 2 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.
1. |
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» D. [x for x in l if x<0] | |
2. |
[1, 1, 1, 1, 1] |
A. | [1, 0, 1, 0, 1] |
B. | [1, 0, 0, 0, 0] |
C. | [0, 1, 0, 1, 0] |
Answer» D. | |