Discuss / Python / code

岁益寒

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

# -*- coding: utf-8 -*-

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

print(L1)

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

print(L2)


  • 1

Reply