title: Is it possible to append stdin input to a list in Θ(n) Python
body: <p>I've got a problem where I need to add items to a list. It has to use stdin, and be in Θ(n). I only seem to be able to get it in Θ(n^2).
  This is my code:</p>
  
  <pre><code>for i in range(int(r1)): # size of list being made
      for line in sys.stdin.readline().strip().split(" "):
          a.append(line)
  Input:  Output: [1, 2, 3]
  1
  2
  3
  </code></pre>
  
  <p>As far as I'm aware that's in Θ(n^2). I have tried doing this:</p>
  
  <pre><code>for i in range(int(r1)): # size of list being made
      a.append(sys.stdin.readline().strip().split(" "))
  Input:  Output: [[1], [2], [3]]
  1
  2
  3
  </code></pre>
  
  <p>Because the elements of the second attempt are in their own sub-lists then they don't work for the rest of my program. Any adivce?</p>