title: AttributeError: 'int' object has no attribute 'split'
body: <p>I'm doing the merge sort in python but I have a problem. When I try to insert the list from the console (one number per line which return a list of string) I cannot convert it in integers. Can you help me understanding the problem.</p>
  
  <pre><code>import sys
  
  def mergeSort(lista):
      res = []
      for i in lista[0].split():
          res.append(int(i))
      if len(res)&gt;1:
          mid = len(res)//2
          lefthalf = res[:mid]
          righthalf = res[mid:]
          mergeSort(lefthalf)
          mergeSort(righthalf)
          i=0
          j=0
          k=0
          while i&lt;len(lefthalf) and j&lt;len(righthalf):
              if lefthalf[i]&lt;righthalf[j]:
                  res[k]=lefthalf[i]
                  i=i+1
              else:
                  res[k]=righthalf[j]
                  j=j+1
              k=k+1
  
          while i&lt;len(lefthalf):
              res[k]=lefthalf[i]
              i=i+1
              k=k+1
  
          while j&lt;len(righthalf):
              res[k]=righthalf[j]
              j=j+1
              k=k+1
      print(res)
  
  alist = []
  for l in sys.stdin:
      alist.append(l.strip())
  mergeSort(alist)
  </code></pre>
  
  <p>The code error says: AttributeError: 'int' object has no attribute 'split'
  The input is a file (given from the shell with the command: "python3 merge.py &lt; data.txt") with the list of numbers one per line. 
  Example:
      2 
      3
      0
      12
      11
      7
      4
  Should return 0 2 3 4 7 11 12
  Of course I don't have an output because of the error</p>