list_1=['Hello', 'World', 18, 'Apple', None] lower_list=[s.lower() for s in list_1 if isinstance(s,str) and s] print(lower_list)
Sign in to make a reply
用户6320474804
list_1=['Hello', 'World', 18, 'Apple', None] lower_list=[s.lower() for s in list_1 if isinstance(s,str) and s] print(lower_list)