Skip to main content
added 131 characters in body
Source Link
Nasser
  • 150.5k
  • 12
  • 161
  • 374

I think this was asked before, but I can't find it now searching.

How about

lis = {94, 35, 47, 29, 86, 40, 46, 72, 87}
{Select[lis, EvenQ[#] &], Select[lis, OddQ[#] &]}

Mathematica graphics

I am sure there are many other ways to do this.

edit:

A little simpler version as suggested in comment thanks to kglr is

{Select[lis, EvenQ], Select[lis, OddQ]}

I think this was asked before, but I can't find it now searching.

How about

lis = {94, 35, 47, 29, 86, 40, 46, 72, 87}
{Select[lis, EvenQ[#] &], Select[lis, OddQ[#] &]}

Mathematica graphics

I am sure there are many other ways to do this.

I think this was asked before, but I can't find it now searching.

How about

lis = {94, 35, 47, 29, 86, 40, 46, 72, 87}
{Select[lis, EvenQ[#] &], Select[lis, OddQ[#] &]}

Mathematica graphics

I am sure there are many other ways to do this.

edit:

A little simpler version as suggested in comment thanks to kglr is

{Select[lis, EvenQ], Select[lis, OddQ]}
Source Link
Nasser
  • 150.5k
  • 12
  • 161
  • 374

I think this was asked before, but I can't find it now searching.

How about

lis = {94, 35, 47, 29, 86, 40, 46, 72, 87}
{Select[lis, EvenQ[#] &], Select[lis, OddQ[#] &]}

Mathematica graphics

I am sure there are many other ways to do this.