image
image
image

Python function return statement

image

Return syntax

return [list of expressions]

Discussion

The return statement can return a value or a None object.

Example

Print(welcome(“Richard”))  #Passing arguments and calling the function

Welcome Richard. Lovely Day!

None  #the returned value

Example of Returning a Value other None

Start IDLE.

Navigate to the File menu and click New Window.

Type the following:

image