Skip to content · ⁨본문 바로가기⁩

Keep the evens

Keep the evens

Filter a list: keep some items and leave the rest out.

Start with an empty list, loop over nums, and .append() each number that passes the test n % 2 == 0. Return the new list after the loop has finished.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP