L1 = ['Hello', 'World', 18, 'Apple', None]
L3 = [x.upper() if isinstance(x, str) else x for x in L1]
L2 = [x.lower() for x in L1 if isinstance(x, str)]
print(L2)
print(L3)
Sign in to make a reply
緣定さんせぃ様
L1 = ['Hello', 'World', 18, 'Apple', None]
L3 = [x.upper() if isinstance(x, str) else x for x in L1]
L2 = [x.lower() for x in L1 if isinstance(x, str)]
print(L2)
print(L3)