LearnPy Hub
← Recursion & Lambda problems
Medium

Recursive Fibonacci

Write a recursive fib(n) with fib(0) = 0, fib(1) = 1. Print fib(n). Keep n small; the plain recursion is slow.

Input

One integer 0 ≤ n ≤ 20.

Output

fib(n)

Sample 1

Input
10
Output
55

Sample 2

Input
0
Output
0
solution.py
Output appears here
Recursive Fibonacci · Python practice problem · LearnPy Hub