Data Structures

profilekings12
stackTest.py

from stack import Stack def main(): s = Stack() print("Is the stack empty", s.isEmpty()) print("Adding items to the stack") s.push(4) s.push("dog") print("The last item in the list", s.peek()) print("Adding another item") s.push(True) print("The number of items in the stack", s.size()) print("Is the stack empty", s.isEmpty()) print("Adding another item") s.push(8.4) print("Removing last item", s.pop()) print("Remove next item", s.pop()) print("The number of items in the stack", s.size()) main()