Skip to content

Instantly share code, notes, and snippets.

@DustinAlandzes
Created March 6, 2019 02:45
Show Gist options
  • Save DustinAlandzes/f83527282e6b1af585eb3900d85b46e0 to your computer and use it in GitHub Desktop.
Save DustinAlandzes/f83527282e6b1af585eb3900d85b46e0 to your computer and use it in GitHub Desktop.
class Stack:
def __init__(self):
self.items = []
def isEmpty(self):
return self.items == []
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def peek(self):
return self.items[len(self.items)-1]
def size(self):
return len(self.items)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment