as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write a python function to print a fibonacci sequence.
user
def printfibonacci(n): 
    a = 0
    b = 1
    if n < 0: 
        print("incorrect input") 
    elif n == 0: 
        print(a) 
    elif n == 1: 
        print(b) 
    else: 
        print(a)
        print(b)
        for i in range(2,n): 
            c = a + b 
            a = b 
            b = c 
            print(b)
assistant