LAB: Fibonacci sequence (recursion)
Please complete in Python. Code provided in screenshot
below.
14.7 LAB: Fibonacci sequence (recursion) The Fibonacci sequence begins with 0 and then follows. All subsequent values are the sum of the previous two, for example: 0, 1, 1, 2, 3, 5, 8, 13. Complete the fibonacci() function, which takes in an index, n, and returns the nth value in the sequence. Any negative index values should return None.
Ex: If the input is:
fibonacci(7)
the output is:
fibonacci(7) is 13
Note: Use recursion and DO NOT use any loops.
LAB ACTIVITY
14.7.1: LAB: Fibonacci sequence (recursion)
0 / 10
main.py
Load default template.
TODO: Write recursive fibonacci() function
name = input()
start_num = int(input())
print('fibonacci({}) is {}'.format(start_num, fibonacci(start_num)))