Write a recursive function to return the nth Fibonacci number in Python

def fibonacci(n): if n <= 1: return n else: return fibonacci(n-1) + fibonacci(n-2)

FG

Related Python Mentoring answers

All answers ▸

What built-in types does python provide?


What is the difference between a float and an integer variable type?


Write a function that takes a string, and outputs that string formatted in camelcase. (alternating upper and lower case for each character, e.g. cAmElCaSe)


What are the main data structures that I can use in Python