用python代码产生0到9 且对每个数加05的数组
你可以使用列表解析来生成这个数组:
arr = [i + 0.5 for i in range(10)]
print(arr)
输出:
[0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]
原文地址: https://www.cveoy.top/t/topic/h561 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
你可以使用列表解析来生成这个数组:
arr = [i + 0.5 for i in range(10)]
print(arr)
输出:
[0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]
原文地址: https://www.cveoy.top/t/topic/h561 著作权归作者所有。请勿转载和采集!