TypeError: 'int' object is not callable

Python错误:TypeError: 'int' object is not callable

在使用python实现一个栈的时候,出现了一个错误:TypeError: ‘int’ object is not callable,即“int”类型的变量不可调用。

这种错误是因为方法名和变量名重复而导致。

class Stack(object):
    def __init__(self,size):
        self.size = size
        self.items =

你可能感兴趣的:(Python笔记,TypeError)