Python 遍历列表项

遍历列表项

您可以使用 for 循环遍历列表项:

实例

逐个打印列表中的所有项目:

thislist = ["apple", "banana", "cherry"]
for x in thislist:
  print(x)

亲自试一试