user
Construct an algorithm to generate the Fibonacci sequence.
Response:
assistant
def generate_fibonacci_sequence(n): 
    a = 0 
    b = 1
    if n < 0: 
        print("Incorrect input") 
    elif n == 0: 
        return a 
    elif n == 1: 
        return b 
    else: 
        for i in range(2,n): 
            c = a + b 
            a = b 
            b = c 
        return b 
  
# Driver Program 
  
print(generate_fibonacci_sequence(9))