Python去除list中的空字符 list1 = ['122', '2333', '3444', '', '', None] a = list(filter(None, list1)) # 只能过滤空字符和None print(a) # ['122', '2333', '3444']