标签:owa span python列表 lan lang pre 效率 string code
为了更有效率的输出列表的每个数据,可以使用循环来完成
demo:
namesList = [‘xiaoWang‘,‘xiaoZhang‘,‘xiaoHua‘]
for name in namesList:
print(name)
结果:
xiaoWang
xiaoZhang
xiaoHua
为了更有效率的输出列表的每个数据,可以使用循环来完成
demo:
namesList = [‘xiaoWang‘,‘xiaoZhang‘,‘xiaoHua‘]
length = len(namesList)
i = 0
while i<length:
print(namesList[i])
i+=1
结果:
xiaoWang
xiaoZhang
xiaoHua
标签:owa span python列表 lan lang pre 效率 string code
原文地址:https://www.cnblogs.com/yzg-14/p/12181749.html