Discuss / Python / 今天终于自己把多几步的给简化了再交作业咯

今天终于自己把多几步的给简化了再交作业咯

Topic source

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

L2=[x.lower() for x in L1 if isinstance(x,str)]

print(L2)


  • 1

Reply