Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Stack(list):
- def push(self, value):
- return self.append(value)
- def pop(self):
- return self.pop() if self else None
- def peek(self):
- return self[-1] if self else None
- @property
- def is_empty():
- return bool(self)
- @property
- def max(self):
- return max(self)
Advertisement
Add Comment
Please, Sign In to add comment