我试图使range
包含结束边界
if distance == 1:
end_boundary = int(d + distance + distance)
else:
end_boundary = int(d + distance + distance - 1)
for y in range(int(d - distance), end_boundary):
# some other code
d
包含int
值,我想知道是否有更好的方法来实现这一点。在
另外,我想让这段代码在d
和distance
包含float
值时工作。在
Tags:
目前没有回答
相关问题 更多 >
编程相关推荐