fork download
  1. class Solution:
  2. def fib(self, n: int) -> int:
  3. if n<=1:
  4. return n
  5. return self.fib(n-1) + self.fib(n-2)
  6.  
  7. k = Solution()
  8. print(k.fib(3))
Success #stdin #stdout 0.03s 5060KB
stdin
Standard input is empty
stdout
2