You can download this code by clicking the button below.
This code is now available for download.
This function calculates the nth term of the Fibonacci sequence
Technology Stack : None
Code Type : Function
Code Difficulty : Intermediate
def fibonacci(n):
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
# JSON Explanation