Discuss / Python / 人生苦短,我用Python

人生苦短,我用Python

Topic source

hcie_zpc

#1 Created at ... [Delete] [Delete and Lock User]
L2 = [ x.lower() for x in L1 if isinstance(x,str) ]  # 只要字符

L2 = [ x.lower() if isinstance(x,str) else x for x in L1 ]  # 只转化了字符

  • 1

Reply