How to remove leading and trailing spaces from strings in a Python list
<p>i have a list:</p>

<pre><code>row=['hi', 'there', 'how', ...........'some stuff is here are ','you']
</code></pre>

<p>as you can see <code>row[8]='some stuff is here are '</code></p>

<p>if the last character is a space i would like to get everything except for the last character like this:</p>

<pre><code>if row[8][len(row[8])-1]==' ':
  row[8]=row[8][0:len(row[8])-2]
</code></pre>

<p>this method is not working. can someone suggest a better syntax please?</p>
