Discuss / Python / 与建空列表及添加值一起练习~

与建空列表及添加值一起练习~

Topic source

Kairos_hh

#1 Created at ... [Delete] [Delete and Lock User]
L1 = ['Hello', 'World', 18, 'Apple', None]

L2 = list()

for item in L1:

    if isinstance(item, str) == True:

        s1 = item.lower() 

        L2.append(s1)

    else:

        pass 

DinosaurSir

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

没有用到列表生成式啊


  • 1

Reply