python 如何将for循环 的结果写成一个数组

23 阅读1分钟
代码实现:
for i in range(10):
   list.append(i)
 print(list)

结果
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]