Defining Tuple of Addition and Subtraction Functions

  • Share this:

Code introduction


Define a tuple of two functions, where the first function is addition and the second function is subtraction.


Technology Stack : Built-in functions

Code Type : Function

Code Difficulty : Intermediate


                
                    
def aaaa(a, b):
    def bbbb():
        return a + b

    def cccc():
        return a - b

    return bbbb(), cccc()