1. list_old = ['1 ','2 ','3'] list_new = [i.strip() for i in list_old]
等价于:
list_new = [] for i in list_old: list_new.append(i.strip())