Exercises on Functions
Test yourself by trying to solve the challenging questions provided in this lesson!
We'll cover the following
Question 1
Write a function that computes the
- The function should be called
fib
and should take as input a single integer value in a variablen
. It should return an integer value representing the Fibonacci number. - The function should use a loop instead of recursion.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy