Important Notice:

return Statement in Python

return Statement in Python

18 views 1 min read

The return Statement in Python

 Python में return statement का उपयोग किसी function से value वापस उस स्थान पर भेजने के लिए किया जाता है, जहाँ से function को call किया गया है। return statement execute होते ही function का execution समाप्त हो जाता है।

English Definition: The return statement is used to send a value back from a function to the place where the function was called. When a return statement executes, the function terminates.

Syntax:

ef function_name():
    return value

Example:

def show():
    return 100

result = show()
print(result)

Output:

100

Explanation:

  • show() function 100 return करता है।

  • result variable returned value को store करता है।

  • print(result) value को screen पर display करता है।

Related Notes