Discuss / Python / fib数列

fib数列

Topic source

姚树为

#1 Created at ... [Delete] [Delete and Lock User]

def fib(max): n=0 b=1 a=b while n<max: if n<=1: print(b) n=n+1 else: temp=a a=b b=a+temp print(b) n=n+1 return 'done' print(fib(6))


  • 1

Reply