Recall & Review
beginner
What does the
return statement do in a Python function?It sends a value back to the place where the function was called, allowing the program to use that value later.
Click to reveal answer
beginner
Can a Python function return more than one value?
Yes, by returning multiple values separated by commas, Python actually returns a tuple containing those values.
Click to reveal answer
beginner
What happens if a Python function does not have a
return statement?The function returns
None by default, which means it does not send any useful value back.Click to reveal answer
beginner
How do you capture the value returned by a function?
You assign the function call to a variable, like
result = my_function(), so you can use the returned value later.Click to reveal answer
intermediate
Is it possible to have multiple
return statements in one function?Yes, you can have several
return statements inside different parts of a function to return different values based on conditions.Click to reveal answer
What does a Python function return if it has no
return statement?✗ Incorrect
If no
return is used, Python functions return None by default.How can a function return multiple values in Python?
✗ Incorrect
Returning multiple values separated by commas actually returns a tuple containing those values.
What is the correct way to get the value returned by a function?
✗ Incorrect
Assigning the function call to a variable stores the returned value for later use.
Can a function have more than one
return statement?✗ Incorrect
Multiple
return statements can be used to return different values depending on conditions.What type of value does a function return if it uses
return 5, 10?✗ Incorrect
Returning multiple values separated by commas returns a tuple with those values.
Explain in your own words what a return value is and why it is useful in a function.
Think about how a function can give you information after it finishes.
You got /3 concepts.
Describe how you can return multiple values from a Python function and how to use them after calling the function.
Remember that multiple values come back as a single package you can unpack.
You got /3 concepts.