Return Statement

0

Return Statement

  • Function can take input values as parameters and executes business logic, and returns output to the caller with return statement. 

  • We can return the result or output from the function using a return statement in the body of the function.

Example:

  • Q. Write a function to accept 2 numbers as input and return sum.

Note: If we are not writing return statement then default return value is None.

 

Post a Comment

0Comments
Post a Comment (0)