🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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)
  1. A.(2, 9)
  2. B.2 9
  3. C.9 2
  4. 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 →