What is the using of return?


Replace this line with your code.


return is the way a function is able to pass a value back to the calling scope. When no value is returned, Python reports this as, None.

def foo(bar):
    print bar

print foo("Bar")

def bar(foo):
    return foo + " => return value"

print bar("Foo")
Foo => return value


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.