我编写了一些代码来评估x和y之间的整数,并通过整数3和5检查可分性.这是代码.
def div_3_5(start, end):
result = 0
result2 = 0
result3 = 0
while start < end:
result2 = start + result
result = result2 - start + 1
if result2 % 3==0 or 5==0:
result3 = result3 + 1
else:
result3 = result3 + 0
return result3
Run Code Online (Sandbox Code Playgroud)
我只是一个初学者,但在代码中一切似乎都很好,除非我错误地使用了"或"语句或错误地检查了可分性.这让我想到了主要问题.任何帮助,将不胜感激.
python ×1