
上QQ阅读APP看书,第一时间看更新
Returning values from a function
Functions can perform a set of defined operations and finally return a value at the end. Let's consider the following example:
def square(a):
return a**2
In this example, the function returns a square of the argument. In Python, the return keyword is used to return a value requested upon completion of execution.