I was doing fine until this week and now feel like I am in way in…

Question Answered step-by-step I was doing fine until this week and now feel like I am in way in… I was doing fine until this week and now feel like I am in way in over my head. I cannot figure out how to move the functions into a library and use the import function. Please help!! Below is the assignment instructions. You are going to enhance the prior assignment by doing the following1) Move all the functions into W5_firstname_lastname_Mylib.py2) Use import to include W5_firstname_lastname_Mylib into the code3) Test the code and make sure that the prior code is still working4) Add the following function into Mylibscalc(p1)p1 will be a string like this “N1, N2, operator”examplesscalc(“20,30,*”)the result will be 600 scalc(“50,20,+”)the result will be 70scalc(“50,20,-“)the result will be 30scalc(“60,20,/”)the result will be 30use string functions to parse the first number, the second number, and the operator from the input string.use the prior functions (add, subtract, divide and multiply ) to do the calculations.In library, do not use any UI functions such as input(), print(), and format. Function should return at least one value to the caller. Below is my current program that I am supposed to be enhancing.  class Error(Exception):   passclass capitalizedError(Error):   pass#Def processing the two inputted numbers (+, -, *, /).def add(firstNumber, secondNumber):            #def add.                                                                        return firstNumber + secondNumber                             def subtract(firstNumber, secondNumber):       #def subtract                                                                   return firstNumber – secondNumber       def multiply(firstNumber, secondNumber):       #def multiply                                                                    return firstNumber * secondNumber        def divide(firstNumber, secondNumber):   return firstNumber / secondNumberdef exceptionOne():                             ###def exceptionOne. I placed an exception here becuase of the ‘division by zero’ error.###    try:       firstNumber / secondNumber   except ZeroDivisionError:       print(firstNumber, “/”, secondNumber, “= 0. You cannot divide by zero!”)   else:        print(firstNumber, “/”, secondNumber, “=”, divide(firstNumber, secondNumber))    def IsInRange (upperLimit,lowerLimit,number):    #Def IsInRange.   if  number > upperLimit or number < lowerLimit:       return False   else:       return True    cont = 'yes'while(cont == 'yes'):      #Set the 'while' loop.    upperLimit = float(input("Please enter the number you would like to use as your upper limit. --> “)) #Input upper limit.   lowerLimit = float(input(“Please enter the number you would like to use as your lower limit. –> “)) #Input lower limit.   firstNumber = float(input(“Please enter your first number. –> “))                                   #Input first number to process.   number = firstNumber   if IsInRange (upperLimit, lowerLimit, number) == False:                                             #Checking inputted number to verify IsInRange. Set If/Else statement.       print(“Invalid number. The number you chose is out of the limits you set. Please check the number and try again.”)   else:                                      secondNumber = float(input(“Please enter a second number. –> “))                               #Input second number to be processed.       number = secondNumber       if IsInRange (upperLimit, lowerLimit, number) == False:                                         #Checking inputted number to verify IsInRange. Set second If/Else statement.           print(“Invalid number. The number you chose is out of the limits you set. Please check the number and try again.”)        else:                                                                                           #Process & display the two inputted numbers           print(firstNumber, “+”,secondNumber, “=”, add (firstNumber, secondNumber))                print(firstNumber, “-“, secondNumber, “=”, subtract (firstNumber, secondNumber))              print(firstNumber, “*”, secondNumber, “=”, multiply (firstNumber, secondNumber))               exceptionOne()       while(True):           try:                                                                                    ###exceptionTwo. I placed an exception here becasue of the tendentcy to capitalize either the ‘yes’ or ‘no’###               print(“Would you like to process two more numbers? Please enter a ‘yes’ or ‘no’.  “) #Check looping request.                           cont = input()               if cont == “Yes” or cont == “No”:                   raise capitalizedError                   break           except capitalizedError:               print(“Please do not use Capitalized letters.”)               continue           if cont == “yes”:               break           else:               cont == “no”               print(“Thank you for trying this calculator!”)               break      Computer Science Engineering & Technology Python Programming ENTD 220 Share QuestionEmailCopy link Comments (0)