[Python 3]How can I get two functions working together : I'm feerly new to python and is still in the learning fase. I recently tried to write errors to a file witch i managed to do after some research. The problem now is I'm trying to write calculation results to a file, but i can't seem to get the two functions I use to work together... Can someone take a look at my code and help me? I appreciate the help.
(as of now have I commented out my function attempt to write the result I get from calculator() to a separat file called "result.txt") 

    import sys
    import logging
    
    WRITE = "w"
    APPEND = "a"
    READWRITE = "r+"
    fileName = "error.txt"
    fileName2 = "result.txt"
    logging.basicConfig(filename=fileName, level=logging.ERROR)
    
    def main():
        checkError()
        return
    
    def calculator():
        firstNumber = int(input("Pleas enter a number: "))
        secondNumber = int(input("Pleas enter a number: "))
        result = firstNumber / secondNumber
        print(result)
        return
    
    def checkError():
        try:
            calculator()
        except:
            error = sys.exc_info()[0]
            logging.error(msg=error)
            print("Error logged to:",fileName )
            return
    
    # def writeResult():
    #     myFile = open(fileName2, mode= WRITE)
    #     myFile.write()
    #     myFile.close()
    #     return
    
    main()