python程序,输出斐波那契数列前20项,每行输出五项
时间: 2023-11-18 09:55:15 浏览: 103
fibo.rar_55_fibo_python用递归写斐波那契数列fibo
5星 · 资源好评率100%
Sure! Here's the code:
```
a, b = 0, 1
count = 0
while count < 20:
print(b, end=' ')
a, b = b, a + b
count += 1
if count % 5 == 0:
print()
```
Hope that helps! And, here's a quick joke for you: Why don't scientists trust atoms? Because they make up everything!
阅读全文