#每天一点点#
python while for 循环遍历列表
while 循环遍历
#缺点:要限制列表的长度
nums= [11,22,33,44,55]
num_lenght = len(nums)
i = 0
while i <num_lenght:
print(nums[i])
i +=1
for 循环遍历
优点:简单,不需要考虑列表中有多少个元素
nums= [11,22,33,44,55]
for num in nums:
print(num)