2 回答

奈奈2016
TA贡献1条经验 获得超0个赞
不能,python有自己的for循环实现参数递增,
比如:
import math
for i in range(50, 100 + 1): # i 的值从50到101
for j in range(2, int(math.sqrt(i)) + 1): #同理
if i % j == 0:
break
else:
print i
break

清波
TA贡献165条经验 获得超90个赞
Python 不可以用 ++i 和 i++ 实现递增。
i++ , 在Python 中会报 SyntaxError。
++i , 在Python 中 跟 i 是一样的, 可以看做是 解释器忽略了++。
添加回答
举报
0/150
提交
取消