Separating odd from even numbers

Imagine the list with integers only, single or double digits.
Is there smarter way to separate odd from even numbers than checking for the decimals after dividing them by 2?

Yes,

3. Attach minimal versions of all the relevant files

It’s friday. Be lazy and use Pufferfish plugin.

try

1 Like

A common algorithm is to use a modulo operator. I see Grasshopper has a native one you might use, but since I don’t know how here’s a Python implementation too:


2402098_SortOddEvenNumbers_00.gh (5.1 KB)

Happy Friday to all :slight_smile:

mod_2024Feb9a

1 Like

Thanks guys! I can see now I was looking in the wrong direction. I will look at the all solutions when I’m back at the office.