Discuss / Python / 求大神

求大神

Topic source

为什么这样不行

L1=['hello','world',18,'Apple',None] L2=[s.lower() for s in L1 if isinstance(s,str)=='Ture'] print(L2)

#或者这样: L1=['hello','world',18,'Apple',None] L2=[s.lower() for s in L1 if isinstance(s,str)==Ture] print(L2)

G东征

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

True 不是 Ture

Edge_c

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

。。额没看到下面的,你忽略我吧

Edge_c

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

True不是str类型


  • 1

Reply