Someone know why I get the error: "AttributeError: 'list' object has no attribute 'apend'" with this codePor que ocorre este errp?
class Stack : def init(self) : self.items = []
def push(self, item) : self.items.apend(item)
def pop(self) : return self.items.pop()
def isEmpty(self) : return (self.items == [])
"AttributeError: 'list' object has no attribute 'apend'" with this code?
s = Stack() s.push(54) print s.pop()
class Stack :
def __init__(self) :
self.items = []
def push(self, item) :
self.items.apend(item)
def pop(self) :
return self.items.pop()
def isEmpty(self) :
return (self.items == [])
s = Stack()
s.push(54)
print s.pop()