title: Elixir: Split list into odd and even elements as two items in tuple
body: <p>I am quiet new to Elixir programming and stuck badly at splitting into two elements tuple.</p>
  
  <p>Given a list of integers, return a two element tuple. The first element is a list of the even numbers from the list. The second is a list of the odd numbers.</p>
  
  <pre><code>Input : [ 1, 2, 3, 4, 5 ]
  Output  { [ 2, 4],  [ 1, 3, 5 ] }
  </code></pre>
  
  <p>I have reached to identify the odd or even but not sure how do I proceed.</p>
  
  <pre><code>defmodule OddOrEven do
  import Integer
  
    def task(list) do
  
  Enum.reduce(list, [],  fn(x, acc) -&gt; 
           case Integer.is_odd(x) do
              :true -&gt; # how do I get this odd value listed as a tuple element
              :false -&gt; # how do I get this even value listed as a tuple element
           end
          #IO.puts(x)
           end
      )     
  end
  </code></pre>