L1 = ['Hello', 'World', -1,-2, 'Apple', None]
L2 = [x for x in L1 if isinstance(x,int) if x<0 ]
print(L2)
Sign in to make a reply
纯情小男Yin
-- coding: utf-8 --
L1 = ['Hello', 'World', -1,-2, 'Apple', None]
L2 = [x for x in L1 if isinstance(x,int) if x<0 ]
print(L2)