Passing function as an argument in Python:
A function can take multiple arguments can be objects, variables(of same or different data types) and functions. Python functions are first class objects. In the example below, a function is assigned to a variable. This assignment doesn’t call the function. It takes the function object referenced by shout and creates a second name pointing to it, yell.
def shout(text): return text.upper() print(shout('Hello')) yell = shout print(yell('Hello'))
Output:
HELLO HELLO