python AttributeError: 'Stack' object has no attribute 'stac
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/10/07 02:26:06
python AttributeError: 'Stack' object has no attribute 'stack'
class Stack(object):
def _init_(self):
self.stack=[]
def push(self,object):
self.stack.append(object)
def pop(self):
return self.stack.pop()
def length(self):
return len(self,stack)
s=Stack()
s.push("Dave")
s.push(42)
s.push([3,4,5])
x=s.pop()
y=s.pop()
print x,y
运行是报错,这是python精要上面的例子.报错的内容是AttributeError: 'Stack' object has no attribute 'stack'
class Stack(object):
def _init_(self):
self.stack=[]
def push(self,object):
self.stack.append(object)
def pop(self):
return self.stack.pop()
def length(self):
return len(self,stack)
s=Stack()
s.push("Dave")
s.push(42)
s.push([3,4,5])
x=s.pop()
y=s.pop()
print x,y
运行是报错,这是python精要上面的例子.报错的内容是AttributeError: 'Stack' object has no attribute 'stack'
_init_(self):
这句,你只打了1个下划线.在init两边要各打2个下划线
__init__这样
这句,你只打了1个下划线.在init两边要各打2个下划线
__init__这样
360浏览器object#has no method'load'
英语竞赛智力题What object has keys that open no locks,space but no
英语单词填空 221 1 分 保存 If no one has any (object)______,I'll decl
英语竞赛智力题,急求What object has keys that open no locks,space but
an internal stack overflow has cased this seemso
object
英语翻译money is no object钱不是问题,请问object在句子里的本意是什么?
java.lang.NullPointerException:No JFreeChart object found on
Which of the following sentences has an object complement?A.
which of following sentences has an object complement?
Which of the following sentences has an object complement?
装系统中断:提示An internal stack overflow has caused this session t