Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Stack2 import Stack
- stack = Stack()
- stack.push("an item")
- print(stack.view()) # That will return the top value, edits made on it will not change data.
- stack.change(stack.view() + " of any type")
- print(stack.view) # Try to guess what this does :P
- stack.pop() # Removes top item
- if stack.isEmpty is True:
- print("Stack is empty") # Prints "Stack is empty" if the stack is empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement