Guest User

Untitled

a guest
Jan 13th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. class Stack(list):
  2.  
  3.     def push(self, value):
  4.         return self.append(value)
  5.  
  6.     def pop(self):
  7.         return self.pop() if self else None
  8.  
  9.     def peek(self):
  10.         return self[-1] if self else None
  11.  
  12.     @property
  13.     def is_empty():
  14.         return bool(self)
  15.  
  16.     @property
  17.     def max(self):
  18.         return max(self)
Advertisement
Add Comment
Please, Sign In to add comment