程序填空+第1题(题号:1224) 题目:以每行5个数来输出300以内债被7或17整除的偶数:并求出其和 def+main(): +sum=0 -*******SPACE*---**+ n=[?] *
时间: 2024-01-17 19:18:33 浏览: 115
```python
def main():
sum = 0
n = []
for i in range(1, 301):
if i % 2 == 0 and (i % 7 == 0 or i % 17 == 0):
n.append(i)
sum += i
if len(n) == 5:
print(*n)
n = []
print("Sum:", sum)
main()
```
阅读全文