def calculator(operation, n1, n2):
return operation(n1, n2) # Using the 'operation' argument as a function
10 and 20 are the arguments.
result = calculator(lambda n1, n2: n1 - n2, 10, 20)
The lambda multiplies them.
print(result)
print(calculator(lambda n1, n2: n1 / n2, 10, 20))
Can we give the operator also as an argu