name_list = ['tom', 'lily', 'rose']

i = 0
while i < len(name_list):
    print(name_list[i])
    i += 1

# 遍历优选for
for i in name_list:
    print(i)

abc8631e60b3adb52480741e598ddc30ee1e0f14
<mask token>

<mask token>
while i < len(name_list):
    print(name_list[i])
    i += 1
for i in name_list:
    print(i)

name_list = ['tom', 'lily', 'rose']
i = 0
while i < len(name_list):
    print(name_list[i])
    i += 1
for i in name_list:
    print(i)

name_list = ['tom', 'lily', 'rose']

i = 0
while i < len(name_list):
    print(name_list[i])
    i += 1

# 遍历优选for
for i in name_list:
    print(i)
