I have a list:
row=['hi', 'there', 'how', ...........'some stuff is here are ','you']
as you can see row[8]='some stuff is here are '
if the last character is a space, I would like to get everything except the last character, such as:
if row[8][len(row[8])-1]==' ':
row[8]=row[8][0:len(row[8])-2]
this method does not work. can anyone suggest a better syntax please?
source
share