Author name: Raparthi Akshaya

How to return a function as a return value in Python

Python return statement: A return statement is used to end the execution of the function call and “returns” the result (value of the expression following the return keyword) to the caller. The statements after the return statement is without any expression, then the special value None is returned. A return statement is overall used to invoke a …

How to return a function as a return value in Python Read More »

How to pass a function as an argument in Python

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 …

How to pass a function as an argument in Python Read More »

Scroll to Top