<prompt> Construct an algorithm to generate the Fibonacci sequence.  <response>: The Fibonacci sequence is a series of numbers where each number is the sum of the two numbers before it. The first two numbers in the sequence are 0 and 1. Below is an algorithm to generate the Fibonacci sequence:1. Define a function generate_fibonacci that takes in a parameter n, where n represents the number of terms to be generated in the sequence.2. Define variables a 0 and b 1 as the first two numbers in the sequence.3. Create an empty list called fibonacci_sequence4. If n is 0 or a negative number, print message Please enter a positive integer5. If n is equal to 1, append a to fibonacci_sequence and return fibonacci_sequence.6. If n is greater than or equal to 2, append a and b to fibonacci_sequence.7. Create a for loop that iterates from the number 2 to the value of n. a. Inside the loop, define c a b to represent each subsequent number as the sum of the two previous numbers. b. Append the value of c to the fibonacci_sequence list. c. Inside the loop, assign the value of b to a and the value of c to b to update the two previous numbers for the next iteration.8. Return fibonacci_sequence upon completion of the loop9. Call the function generate_fibonacci with a specified value of n to generate the desired number of terms.Example Python code:def generate_fibonaccin: a 0 b 1 fibonacci_sequence if n 0: printPlease enter a positive integer elif n 1: fibonacci_sequence.appenda else: fibonacci_sequence.appenda fibonacci_sequence.appendb for i in range2, n: c a b fibonacci_sequence.appendc a b b c return fibonacci_sequencegenerating the first 10 terms of the Fibonacci sequenceprintgenerate_fibonacci10 