Python Developer — Medium
Key points
- List comprehension filters numbers based on the condition x % 2 == 0.
- Only even numbers from the range 0 to 4 are included in the output.
- The syntax [x for x in range(5) if x % 2 == 0] generates the list.
Ready to go further?
Related questions
