def printFibonacci(n): \n    a = 0\n    b = 1\n    if n < 0: \n        print("Incorrect input") \n    elif n == 0: \n        return a \n    elif n == 1: \n        return b \n    else: \n        for i in range(2,n):  \n            c = a + b \n            a = b \n            b = c \n        return b\n\nprintFibonacci(n)
Write an algorithm to print the nth element in a Fibonacci sequence.?