L = ['Hello', 'World', 18, 'Apple', None] [s.lower() for s in L if isinstance(s,str)==True]
可以不用==True把
错了吧
L2 = [] LL = [] for x in L1: if isinstance(x,str): LL.append(x) L2 = [s.lower() for s in LL]
Sign in to make a reply
查理斯顿
L = ['Hello', 'World', 18, 'Apple', None] [s.lower() for s in L if isinstance(s,str)==True]