Discuss / Python / 可行

可行

Topic source

Ashen One

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

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

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

print(L2)


  • 1

Reply