KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

What is the purpose of return statement in Python functions?

  1. It is used to terminate the execution of a function
  2. It is used to define the output of a function
  3. It is used to import modules into a function
  4. None of these

Python Functions

1 Like

Answer

It is used to terminate the execution of a function

Reason — The return statement ends the execution of a function and transfers the control back to the place where the function was called. Once the return statement is executed, no further statements in the function body are executed.

Answered By

1 Like


Related Questions