title: What's the difference between lists enclosed by square brackets and parentheses in Python?
body: <pre><code>&gt;&gt;&gt; x=[1,2]
  &gt;&gt;&gt; x[1]
  2
  &gt;&gt;&gt; x=(1,2)
  &gt;&gt;&gt; x[1]
  2
  </code></pre>
  
  <p>Are they both valid? Is one preferred for some reason?</p>