Discuss / Python / 基础不好,纠结了半天才写出来

基础不好,纠结了半天才写出来

Topic source

大炳子1995

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

L2=[a.lower() for a in L1 if isinstance(a,str) is true]

大炳子1995

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

T要大写,当然is True写不写都无所谓,只要isinstance判定正确就整个都能运作。


  • 1

Reply