Imagine I have a two functions
def areaSquare(a,b):
print( a * b)
def areaCircle(radius):
print(3.14159 * radius ** 2)
And I want to create a third function that is called area.
area(areaCircle,radius = 3, repeat = 5)
# prints 3.14159 * 9 five times
area(areaSquare, a = 2, b = 3, repeat = 6)
# prints 2 * 6 six times
So the function takes a function as a parameter. Depending on the function which is passed to it as a parameter, it should require additional parameters. Is there a way to achieve this? I know function overloading would be an option. But I do not want to define multiple functions for this purpose.