#这是源代码
x_values = list(range(1001))
y_values = [x**2 for x in x_values]
#之前不知道这个用法的时候,我经常写成下面的方式
x_values = list(range(1,1001))
y_values = []
for x in x_values:
y_values.append(x**2)
#这是源代码
x_values = list(range(1001))
y_values = [x**2 for x in x_values]
#之前不知道这个用法的时候,我经常写成下面的方式
x_values = list(range(1,1001))
y_values = []
for x in x_values:
y_values.append(x**2)