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

Function is_same

balance_parenthesis.py:21–29  ·  view source on GitHub ↗
(p1, p2)

Source from the content-addressed store, hash-verified

19
20
21def is_same(p1, p2):
22 if p1 == "(" and p2 == ")":
23 return True
24 elif p1 == "[" and p2 == "]":
25 return True
26 elif p1 == "{" and p2 == "}":
27 return True
28 else:
29 return False
30
31
32def is_balanced(check_string):

Callers 1

is_balancedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected