human利用循环语句输出1到50中5的倍数将其存放到一个列表中。使用Python
代码如下:
multiple_of_five = []
for i in range(1, 51):
if i % 5 == 0:
multiple_of_five.append(i)
print(multiple_of_five)
输出:
[5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
原文地址: https://www.cveoy.top/t/topic/fcUY 著作权归作者所有。请勿转载和采集!