示例:数字的平方 # loops_demo.py# Generate a list of squaressquares = [x ** 2 for x in range(10)]print(squares) 为什么使用它?列表推导式比传统的 for 循环更紧凑 ...