← Quiz: Python Functions: all 15 questions
Quiz: Python Functions · Question 11 of 15
What does this print? (code)
What does this print?
def min_max(nums):
return min(nums), max(nums)
low, high = min_max([7, 2, 9])
print(low, high)
- A.(2, 9)
- B.2 9
- C.9 2
- D.An error, a function can return only one value
Answer & explanation
Correct answer: 2 9
return with two values returns a tuple, which is unpacked into low and high.
Can you get the rest right without peeking?
Take the timed Quiz: Python Functions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →