Run
nums = [5, 8, 2, 3, 9, 44, 21] def is_even(n): return n % 2 == 0 # Filter even numbers in the nums list filtered_nums = filter(is_even, nums) # Print the filtered list print(f"Filtered list : {list(filtered_nums)}")
Output