Use a for loop to traverse the entire list information
colors = ["yellow", "blue", "orange", "purple"] //定义列表
for color in colors: //从列表colors取出一个颜色,并将其存在变量color中
print(color)
print("These colors are all my favorite colors") //为for循环外的代码块,在for循环结束后执行
//输出结果为:
yellow
blue
orange
purple
These colors are all my favorite colors