Advertisement
haopoka

Fibonacci (Python)

Feb 14th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. def fibo(a):
  2.     if(a==1):
  3.         return 1
  4.     if (a==2):
  5.         return 2
  6.     return fibo(a-1)*fibo(a-2)
  7.  
  8. x = int(input("Nhập một số nguyên <100: "))
  9. print("Số fibonacci của ",x," là ",fibo(x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement