title: SyntaxError when using a semicolon after import in Python
body: <p>I want to execute the following command:</p>
  
  <pre><code>python -c "import os, random, string; for _ in range(30): os.mkdir(''.join(random.choice(string.ascii_lowercase) for _ in range(random.randint(3, 10))))"
  </code></pre>
  
  <p>But I'm getting:</p>
  
  <pre><code>  File "&lt;string&gt;", line 1
      import os, random, string; for _ in range(30): os.mkdir(''.join(random.choice(string.ascii_lowercase) for _ in range(random.randint(3, 10))))
                                   ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Why does this error occur?</p>
  
  <p>Same code with linebreaks and without the semicolon:</p>
  
  <pre><code>import os, random, string
  
  for _ in range(30):
      os.mkdir(''.join(
          random.choice(string.ascii_lowercase) for _ in range(random.randint(3, 10))
          ))
  </code></pre>