Created
June 3, 2023 14:17
-
-
Save cod3smith/9175c08c177931417e8a220807f73efa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stack: | |
def __init__(self): | |
self.STACK = [] | |
def push(self, element): | |
self.STACK.append(element) | |
return self.STACK | |
def check_empty(self): | |
return len(self.STACK) == 0 | |
def pop(self): | |
if self.check_empty(): | |
return "stack is empty" | |
return self.STACK.pop() | |
def peek(self): | |
return self.STACK | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment