Python 代码编译错误:多余右括号的解决方法
这串代码编译错误是因为在第4行的 if 语句中,多了一个右括号 ')'。正确的代码应该是:
a, b = int(input()), int(input())
for i in range(a, (b + 1)):
if i % 2 == 1 and i % 3 != 0 and i % 5 != 0:
print(i, end=' ')
移除多余的右括号后,代码就可以正常编译运行了。
原文地址: https://www.cveoy.top/t/topic/pgNg 著作权归作者所有。请勿转载和采集!