The return statement indicate that return exits in a function and optionally pass back an expression to the caller variable and return statement with no arguments is the same as return None variable.
For example you can see below code and try it.
# Function definition is here
def sum( arg1, arg2 ):
# Add both the parameters and return them."
total = arg1 + arg2
print "Inside the function : ", total
return total;
# Now you can call sum function
total = sum( 15, 30 );
print "Outside the function : ", total
Output- Inside the function :45
Outside the function :45
0 Comment(s)