提取列表中长度大于3的字符串,列表中什么元素都有


lt = [12,'34346',5,'sdfsg','23','d','4567',5556]
lt1 = []
S = filter(lambda x: type(x) == str,lt)
for i in S:
    if len(i)>3:
        lt1.append(i)
print(lt1)
展开阅读全文

没有更多推荐了,返回首页