Answer:
Hi Castiel! One way to implement this program is by using regular expressions combined with file operations in Python. Please find the answer explanation below:
Explanation:
First, we define the variables for the input and output files. Then, we can declare separate arrays for each kind of parenthesis (braces, curly brackets, parenthesis) so that we can count the total number of opening parenthesis and tally with the count of the total number of closing parenthesis. Please refer to the attachment "balanced.py".