Discuss / Python / icecola日常

icecola日常

Topic source

-- 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)


  • 1

Reply