L1 = ['Hello','World',18,'Apple',None]
[s.lower() for s in L1 if isinstance(s,str)]
打印出来的结果就是 ['hello','apple','world']
Sign in to make a reply
deaddeaddead2
L1 = ['Hello','World',18,'Apple',None]
[s.lower() for s in L1 if isinstance(s,str)]
打印出来的结果就是 ['hello','apple','world']