www.aiquanti.com
用Python的for循环实现等差序列相加,例如(1+2+3+4+5+...+20)这样的算法,代码如下:
import math
temp = 0
for x in range(1" />
更新时间:2021-07-17 23:54:43作者:admin2
百度搜索圈T社区 免费行业视频教程
www.aiquanti.com
用Python的for循环实现等差序列相加,例如(1+2+3+4+5+...+20)这样的算法,代码如下:
import math
temp = 0
for x in range(1,20):
temp += x
break
else:
print temp
#输入结果:210