diff --git a/stack/Python/stack.py b/stack/Python/stack.py index 8ae7ecf8..6c65f28b 100644 --- a/stack/Python/stack.py +++ b/stack/Python/stack.py @@ -24,8 +24,7 @@ def pop(self): """ if len(self.stack) <= 0: - # Raise an error if stack is empty. - return "No element in the Stack" + raise IndexError("No element in the Stack") else: return self.stack.pop()