MCPcopy Index your code
hub / github.com/geekcomputers/Python / Stack

Class Stack

balance_parenthesis.py:1–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Stack:
2 def __init__(self):
3 self.items = []
4
5 def push(self, item):
6 self.items.append(item)
7
8 def pop(self):
9 return self.items.pop()
10
11 def is_empty(self):
12 return self.items == []
13
14 def peek(self):
15 return self.items[-1]
16
17 def display(self):
18 return self.items
19
20
21def is_same(p1, p2):

Callers 1

is_balancedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected