Discuss / Python / 这样可以不?

这样可以不?

Topic source

友仔

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

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

print([s.lower() if isinstance(s,str)==True else s for s in L])


  • 1

Reply