Python实现斐波那契数列
x,y=1,1print('1'+','+'1',end=',')
import time
time.sleep(1)
while 1:
x=x+y
y=x+y
print(str(x)+','+str(y),end=',')
time.sleep(1)
有木有大佬看看这个能否再精简点?{:10_257:} from sys import stdout
x=y=1
while True:
stdout.write(f"{x},{y},")
x+=y
y+=x 本帖最后由 jackz007 于 2020-6-20 11:37 编辑
x , y = 1 , 1
print(x , end = '')
for _ in range(20):
x , y = y , x + y
print(' , ' , x , end = '')
print(' , ' , y)
页:
[1]