title: How to access a value from a list of tuples in erlang and create a new list out of it?
body: <p>The problem is to get the list of first element of each tuple in a list. Erlang is giving me a hard time. How do I add elements dynamically in a list in erlang?</p>
  
  <pre><code>I tried to read the list of tuples and store it into another list to get the first element of each tuple in the list.
  
    getBankList([BankData|T]) -&gt;
      {BankName, Resource}=T,
      createList(BankName),
      getBankList(T).
  
  createList(Name)-&gt;
    List = [],
   List2 = [Name|list1].
  
  [{jill,450},
  {joe,157},
  {bob,100},
  {sue,125},
  {pat,344}].
  </code></pre>
  
  <p>These are the of tuples, I need the list as:
  [jill,joe,bob,sue,pat]</p>