Problem Statement
Can a function be passed as an argument in Python?
Explanation
Functions in Python are first-class objects. This means they can be stored in variables, returned from other functions, or passed as arguments just like numbers or strings.
This feature enables higher-order functions, where one function operates on another, such as custom sort keys or functional programming patterns like map and filter.
Code Solution
SolutionRead Only
def add(x,y): return x+y def apply(f,a,b): return f(a,b) apply(add,3,5)
