Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python fix matching.py to pass matching_test.py LI 00 9 matching.py 1 MODIFY ME TO IMPLEMENT YOUR SOLUTION 2 # TO PROBLEM 2: BRACE MATCHER 3
python
fix matching.py to pass matching_test.py
LI 00 9 matching.py 1 MODIFY ME TO IMPLEMENT YOUR SOLUTION 2 # TO PROBLEM 2: BRACE MATCHER 3 # 4 # NAME: FIXME 5 # ASSIGNMENT: Technical HW: Stacks & Queues 6 7 from Stack import Stack 8 9 # Returns True if the braces match, 10 # & False otherwise 11 def matcher(str): 12 Sri Stack() 13 return True 14 15 def main(): 16 print("matcher: ", matcher("[0]")) 17 18 # Don't run main on import 19 if __name_ main__": 20 main() 21 22 E 6 111 matching_test.py 1 # TEST FILE FOR MATCHER 2 # DO NOT MODIFY 3 from matching import matcher 4 5 E def test_matcher_pass_solo1(): 6 assert matcher("[ ]") == True 7 8 def test_matcher_pass_solo2(): 9 assert matcher("{ }") == True 10 11 def test_matcher_pass_none(): 12 assert matcher("hello") == True 13 14 E def test_matcher_pass_arith(): 15 | assert matcher("(45 + 36) - 5") == True 16 17 def test_matcher_pass_mix2(): 18 assert matcher("[0]") == True 19 20 Edef test_matcher_pass_mix3(): 21 lassert matcher("{[()]}") == True 22 23 E def test_matcher_pass_mix5(): | assert matcher("{ () [ [] ({}) } }") == True 25 26 def test_matcher_pass_mix_lots(): assert matcher("{[0]} [ ] ( ) ([{}]) { () [ [] ( {} ) ] } ( {[O] [] } {} )") == True 2 4 27Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started