Recursion · 8 / 18 Exercise Medium

Calculate Fibonacci series numbers

Objective

Create a Python program that uses recursion to calculate a number of the Fibonacci sequence. The sequence starts with the numbers 1 and 1 and each following term is the sum of the two previous ones.

Instructions

  • Ask the user for a number n.
  • Implement a recursive function that calculates the term n of the sequence.
  • Print the result on the screen.
Input
13
Output
233

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise