PCEP Control Flow, Loops, Lists and Logic • Set 2
PCEP Control Flow, Loops, Lists and Logic Practice Test 2 — 15 questions with explanations. Free, no signup.
A developer needs to write a loop that prints all even numbers from a list. They attempt: for num in numbers: if num % 2 == 0: print(num). However, they want a more efficient approach using list comprehension. Which alternative achieves the same result?
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.