Fibonacci number
easyMaths and loops10 XP
The Fibonacci numbers start 0, 1, and each next one is the sum of the two before: 0, 1, 1, 2, 3, 5, 8… Return the n-th one, counting from 0.
Examples
- Input: n = 0Output: 0
- Input: n = 1Output: 1
- Input: n = 6Output: 8
Examples use JSON: true/false/null are True/False/None in Python.