mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-09 10:58:02 +00:00
Added stack method is_empty().
This commit is contained in:
@@ -23,4 +23,7 @@ class Stack(object):
|
||||
def peek(self):
|
||||
if self.top is not None:
|
||||
return self.top.data
|
||||
return None
|
||||
return None
|
||||
|
||||
def is_empty(self):
|
||||
return self.peek() is None
|
||||
Reference in New Issue
Block a user