ReferenceKeywords
return
Ends a function and hands a value back to the caller.
Signature
return valueReturns
The value, or None for a bare return.
Example
Python
def check(n):
if n < 0:
return
return "ok"
print(check(-1))
print(check(1))Output
None ok