I am trying to remove white spaces from a list of strings in Python. I have tried almost every other method, but still I am not able to remove the spaces. Here is the list:
names=[': A slund\n', ': N Brenner and B Jessop and M Jones and G Macleod\n', ': C Boone\n', ': PB Evans\n', ': F Neil utitle: uThe architecture of markets}\n', ': PA Hall and D Soskice\n', '', '', '', '', '', '', '', ': EBYP HIGONNET and DS LANDES and H ROSOVSKY\n', '', '', '', '', '', '', ': DS Landes\n', '', '', '', '', '', '', '', ': DC North\n', '', '', '', '', '', '', '', ': K Polyani\n', '', '', '', '', '', '']
Here is my code:
for i in names:
if len(i)== 0: // i=='' // len(i)<=1
names.remove(i)
print names