Discuss / Python / 没写成一行

没写成一行

Topic source

飞页快刀

#1 Created at ... [Delete] [Delete and Lock User]

L1 = ['Hello', 'World', 18, 'Apple', None]

L2 = []

for i in L1:

    if  isinstance(i, str):

        L2.append(i)

print([s.lower() for s in L2])


  • 1

Reply