# Implement a complex subtraction precedence operation with parentheses
# mainly used in regular expressions, while loops, lists of several methods.
# to implement the required arithmetic functions the code is divided into two parts, and one is a function that implements the subtraction operation without parentheses Add_sub_mul_div
# The other one is a loop plus 6 lines of code to constantly remove the inner parentheses and complete the parentheses inside the expression, which will call the function continuously Add_sub_mul_div
# Instance A = ' 1-2* (3+4/((5-6*7) +8) *9/10-(11+12) *13*14/15/(16-17)/18/19) *20 '
# operation Result A =-146.67385897694427
# Beginner Python code may be complicated ... Will humbly accept the advice and continue to learn!ps: Morning spent four hours to write subtraction and continue to verify the case ...
# Two hours in the afternoon to write the function of the parentheses and invoke the subtraction verification instance, each time after the completion of the run, but there are various errors ...
# such as the processing of a positive negative integer, and the beginning of the write function multiplication operation from left to right does not take into account ... Wait a minute
# code Body:
Import re
A = ' 1-2* (3+4/((5-6*7) +8) *9/10-(11+12) *13*14/15/(16-17)/18/19) *20 '
b = Re.findall (' ([\d\.] +|-[\d\.] +|\+|/|\*|-|\ (|\) ', a) # Displays the positive, negative, and subtraction operators in a string individually in the list
# due to direct copying over the format is too messy, directly pasted.
Using Python to implement calculator functions