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()
del s
length()返回什么啊?怎么用?你是动态的对吗?动态的如果输错一个,CLASS就得全部重输对吗?