Python common exception handling TypeError: '' object is not callable

For Python running in the console:
TypeError: '' object is not callable

The semantics of this statement is: an object cannot be called
Insert picture description here
Insert picture description here

For this type of quoted parameter object cannot be called, the possible problems are:
Insert picture description here

··· The variable name of the defined parameter is the same as the name of the defined function
··· The name of the parameter type is wrong and does not match the actual
··· No return value


TypeError: ‘NoneType ’ object is not callable
Insert picture description here

The possible problems are

··· def definition does not return return value
··· return does not adjust indentation
Insert picture description here

Insert picture description here

Guess you like

Origin blog.csdn.net/JasonZ227/article/details/109771388