title: Why do I get an error in Python when I try to read several strings with spaces in between from stdin?
body: <p>I don't know why my online ide throws an error when I execute this code:</p>
  <pre><code>n = int(input())
  
  lst = []
  
  for i in range(n):
      lst.append(input())
  
  print(lst)
  </code></pre>
  <p>When I give these as input:</p>
  <pre><code>5
  first string
  second string
  third string
  almost done
  done now
  </code></pre>
  <p>I get this error:</p>
  <pre><code>$python main.py
  Traceback (most recent call last):
    File &quot;main.py&quot;, line 6, in &lt;module&gt;
      lst.append(input())
    File &quot;&lt;string&gt;&quot;, line 1
      first string
                 ^
  SyntaxError: invalid syntax
  
  </code></pre>
  <p>Funny thing is, I run the same code with the same input on VS Code and face no errors, and even get the result:</p>
  <pre><code>['first string', 'second string', 'third string', 'almost done', 'done now']
  </code></pre>
  <p>What's happening? I'm confused...</p>