Discuss / Python / 练习

练习

Topic source

LesLieM樂

#1 Created at ... [Delete] [Delete and Lock User]
>>> L1 = ['Hello', 'World', 1, 'IBM', 'Apple', None]
>>> L2 = [s.lower() for s in L if isinstance(s, str)]
>>> L2
['hello', 'world', 'ibm', 'apple']

  • 1

Reply