I have a Python array.
arr = [1, 2, 3, 4, 5]
I want to remove N
with a certain condition from the arr
and store it again in the arr
.
The condition: the remainder divided by 2 is 0 (it can be any other condition depending on the context)
For example, when removing N
the remainder divided by 2 is 0, the result should be [1, 3, 5]
. I want to use lambda for this but I don't know how.
Using JavaScript I can do this like this.
How can I achieve this?