Write a function that calculate fibonacci number. Write it using recursion/loop (whichever you did not use in the first question).
Implement def fibonacci(n): for a nonnegative integer n. Return the nth Fibonacci number using F(0) = 0 and F(1) = 1. Provide an implementation using the approach not used in the first question, and ensure it handles the stated bounds.
def fibonacci(n):