CSc 7003, Programming for Data Science (Summer 2023)
Program 4 - Stacks
Complete the methods in the following files:
Sample runs of the two driver programs are shown below:Reverse
$ python3 Reverse.py input a string (q to quit): abcdef reverse of string: fedcba input a string (q to quit): madam reverse of string: madam input a string (q to quit): q
Matching Parentheses
$ python3 MatchingParen.py Enter string (q to quit): {([])} BALANCED Enter string (q to quit): ()[]([]) BALANCED Enter string (q to quit): ()) NOT BALANCED Enter string (q to quit): ((]] NOT BALANCED Enter string (q to quit): q