列表推导式提供了循环遍历列表的最短语法:一个简短的列表推导式(for表达式),将打印列表中的所有项目:fruitlist = ["apple", "banana", "cherry"][print(x) for x in fruitlist]执行结果:applebananacherry