KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Is the return statement mandatory for every function?

Python Functions

1 Like

Answer

No, the return statement is not mandatory for every function. If a function does not contain a return statement, it does not return any value and is called a void (or non-fruitful) function. In such cases, the function returns None automatically.

Answered By

3 Likes


Related Questions