用Python3 4. (程序题)编写程序,输出 1×2×3+3×4×5+5×6×7+...+99×100×101的值。
时间: 2024-01-13 10:03:14 浏览: 122
Python输入3个值比较大小,计算1-2+3-4+5...100的值的两个代码程序
Sure, I can help you with that! Here's the Python 3.4 code to output the value of 1 x 2 x 3, 3 x 4 x 5, 5 x 6 x 7 ... 99 x 100 x 101:
```
result = 1
for num in range(1, 102, 2):
result = result * num * (num + 1)
print(result)
```
This program uses a for loop to iterate through the odd numbers between 1 and 101 (inclusive), and multiplies them together to get the final result. Let me know if you have any questions!
阅读全文