Track 5 · Lesson 6 of 12
Returning multiple values
Return several results at once as a tuple and unpack them into separate variables at the call site.
You will be able to
- Return several values from one function by separating them with commas
- Explain that the values travel together as a single tuple
- Unpack a returned tuple into variables, in the right order
- Diagnose unpacking errors and values unpacked in the wrong order
Included with a Formula Quest membership
It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.
View Formula Quest memberships
Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.