我有一个从mysql数据库附加的对象列表,并包含空格.我希望删除下面的空格,但我使用的代码不起作用?
hello = ['999 ',' 666 '] k = [] for i in hello: str(i).replace(' ','') k.append(i) print k
python list
list ×1
python ×1