It's true that you can use that, but I wanted to keep it pretty clear in my post. But your trick is useful in "small" functions like this one to avoid making the code ugly
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just a quick note (that can count as another trick): you can simplify the
my_filter
function to thereturn x==3 or x%2==0
It's true that you can use that, but I wanted to keep it pretty clear in my post. But your trick is useful in "small" functions like this one to avoid making the code ugly