Machine learning calculus

Hi.
I don’t understand why my code does not print the same result as the answer code.

Best Regards

import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,3,100)
def equation(x):
    return 3*x-1-np.square(x)
y = []
for number in x:
    y.append(equation(number)) 

plt.plot(x,y)

What I expected to happen:

#same result as this
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 3, 100)
y = -1*(x**2) + x*3 - 1
plt.plot(x,y) What actually happened:

Please provide the screen link.