Skip to content

Commit 65cc855

Browse files
authored
minor updates (keon#822)
1 parent 23d4e85 commit 65cc855

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

algorithms/stack/stack.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
It needs no parameters and returns the item. The stack is modified.
99
peek() returns the top item from the stack but does not remove it.
1010
It needs no parameters. The stack is not modified.
11-
isEmpty() tests to see whether the stack is empty.
11+
is_empty() tests to see whether the stack is empty.
1212
It needs no parameters and returns a boolean value.
13-
size() returns the number of items on the stack.
14-
It needs no parameters and returns an integer.
1513
"""
1614
from abc import ABCMeta, abstractmethod
1715
class AbstractStack(metaclass=ABCMeta):
@@ -72,15 +70,15 @@ def push(self, value):
7270

7371
def pop(self):
7472
if self.is_empty():
75-
raise IndexError("stack is empty")
73+
raise IndexError("Stack is empty")
7674
value = self._array[self._top]
7775
self._top -= 1
7876
return value
7977

8078
def peek(self):
8179
"""returns the current top element of the stack."""
8280
if self.is_empty():
83-
raise IndexError("stack is empty")
81+
raise IndexError("Stack is empty")
8482
return self._array[self._top]
8583

8684
def _expand(self):

0 commit comments

Comments
 (0)