请问用python怎么计算从1到1000内不能被5或7整除的整数的geshu?
你题目的解答代码如下:
count = 0 for i in range(1,1001): if i%5!=0 and i%7!=0: count += 1 print(count)
结果
如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!