擅长:python、mysql、java
<blockquote>
<p><strong>Python return statement</strong> </p>
<p>The return statement is used to return from a function i.e. break out
of the function. We can optionally return a value from the function as
well.</p>
</blockquote>
<pre><code>def test_function():
a = "hello"
return a # returns variable a
def test_function2():
a = test_function()
if a == "hello":
print(a)
else:
print("hello world")
test_function2()
</code></pre>