[Solved] Python TypeError: ‘int’ object is not callable

TypeError:’int’ object is not callable

The reason for this error is simple

Look at the following program:

1  def loss(a,b):
 2      return a- b
 3  
4 loss = 0
 5 loss = loss(5,2)+1

Error positioning:

loss = loss(5,2)+1
TypeError:’int’ object is not callable

 

the reason:

Function name loss

Variable name loss

coincide! ! !

 

Similar Posts: