Skip to main content
adicionou 48 caracteres ao conteúdo
Fonte Link
Maniero
  • 484,4mil
  • 94
  • 1,3mil
  • 2,2mil

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()

Someone know why I get the error: "AttributeError: 'list' object has no attribute 'apend'" with this code?

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()

Por que ocorre este errp?

"AttributeError: 'list' object has no attribute 'apend'" with this code?

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()
Fonte Link

AttributeError: 'list' object has no attribute 'apend'

Someone know why I get the error: "AttributeError: 'list' object has no attribute 'apend'" with this code?

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()