TypeError: ‘dict’ object is not callable

def fit(self,X,Y,epochs=1):

self.w = np.ones(X.shape[1])

self.b=0

accuracy={}

max_accuracy=0

for i in range(epochs):

  for x,y in zip(X,Y):

    y_pred= self.model(x)

    if y==1 and y_pred==0:

      self.w=self.w + x

      self.b=self.b + 1

    elif y==0 and y_pred==1:

      self.w=self.w - x

      self.b=self.b - 1

  accuracy[i] = accuracy_score(self.predict(X),Y)

  if(accuracy[i]>max_accuracy):

    max_accuracy=accuracy[i]

print(max_accuracy)

**plt.plot(accuracy.values())**                           

plt.show()

perceptron= Perceptron()
perceptron.fit(X_train,Y_train,5)

in fit(self, X, Y, epochs)
35
36 print(max_accuracy)
—> 37 plt.plot(accuracy())
38 plt.show()

TypeError: ‘dict’ object is not callable

accuracy is declared as dictionary, so you cannot use () with it. Remove the ().

If I do that it displays the following error :
TypeError: float() argument must be a string or a number, not ‘dict’

In the video tutorial the following code was working perfectly, but for some reasons it gives me error at plt.plot(accuracy.values())…I also tried running it after removing (), but still there is error.
:

for i in range(epochs):

  for x,y in zip(X,Y):

    y_pred= self.model(x)

    if y==1 and y_pred==0:

      self.w=self.w + x

      self.b=self.b + 1

    elif y==0 and y_pred==1:

      self.w=self.w - x

      self.b=self.b - 1

  accuracy[i]= accuracy_score(self.predict(X), Y)

plt.plot(accuracy.values())                   #this line shows error(but it works in video tutorial?)

plt.show()

wrap accuracy.values() inside list.