AnswerBox
Python

Fibonacci Sequence

Description:
Generate the Fibonacci sequence up to n terms.
Python Code
def fibonacci(n):
    a, b = 0, 1
    for _ in range(n):
        print(a, end=" ")
        a, b = b, a + b

fibonacci(10)
Expected Output
0 1 1 2 3 5 8 13 21 34