From 7dc21d2fce9f70e541ce777509279ce6f8bc2571 Mon Sep 17 00:00:00 2001 From: "Richard Horton (hortonr6)" Date: Fri, 19 Jul 2019 17:20:48 +0100 Subject: [PATCH] Added Print Functions --- Stacks-Queues.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Stacks-Queues.py b/Stacks-Queues.py index 690ba1c..8ad0f9c 100644 --- a/Stacks-Queues.py +++ b/Stacks-Queues.py @@ -10,6 +10,9 @@ class Stack: '''Pops the item at the top of the stack''' return self.stack.pop(len(self.stack) - 1) + def printStack(self): + for item in self.stack: + print(item) class Queue: def __init__(self): @@ -23,3 +26,7 @@ class Queue: '''Pops the item at the front of the queue''' return self.queue.pop(0) + def printQueue(self): + for item in self.queue: + print(item) +