Kristi W.

asked • 02/04/20

Fibonacci Graph Program

I have to create a program that will plot on a graph the ratio between consecutive Fibonacci numbers for say 100 numbers that demonstrate the golden ratio. This is what I have:


import matplotlib.pyplot as plt


def Fibonacci_Graph():

def fibo(n):

if n == 1:

return [1]

if n == 2:

return [1, 1]

a = 1

b = 1

series = [a,b]

for i in range(n):

c = a+b

series.append(c)

a = b

b = c

return series

plt.plot(a,b)

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.