def fibonacci(n): fib_sequence = [0, 1] for i in range(2, n): fib_sequence.append(fib sequence[-1] + fib sequence[-2]) return fib sequence n = 10 fib sequence = fibonacci(n) plt.figure(figsize=(10, 5)) plt.plot(range(n), fib_sequence, marker='o') plt.title('Fibonacci Sequence') plt.xlabel('Index') plt.ylabel('Fibonacci Number') plt.xticks(range(n)) plt.grid() plt.show()