diff --git a/Stack/stack.py b/Stack/stack.py index 55f9f0f..e144f23 100644 --- a/Stack/stack.py +++ b/Stack/stack.py @@ -73,7 +73,7 @@ class Stack: if len(self) == 0: raise StackError("Cannot pop from empty Stack") lastitem = self.data[-1] - self.data = self.data[:-1] + del self.data[-1] return lastitem def populate(self, itemlist, destructive=False): @@ -122,4 +122,4 @@ class Stack: returns None """ self.data = self.data[:value] - self.maxlen = value \ No newline at end of file + self.maxlen = value