Function Without return :-
यदि किसी function में explicit return statement नहीं लिखा जाता है, तो Python function के समाप्त होने पर अपने आप None return करता है।
English : If a function does not contain an explicit return statement, Python automatically returns None when the function finishes.
Example:
Output:
Explanation:
print("Hello Python") message को screen पर display करता है।
Function में explicit return statement नहीं है।
इसलिए show() का returned value None होता है।
result variable में None store होता है।
Important: return बिना value के भी लिखा जा सकता है। return और return None दोनों function से None return करते हैं और function को समाप्त कर देते हैं।
Example 2:
Output:
None