Return Multiple Values From A Function Using Tuples

10 months ago
7

In this example, the get_person_details function returns a tuple with three values (name, age, and city). The individual values can be assigned to variables during the function call or afterward.
Using multiple return values is a convenient way to package related pieces of information together and make your code more expressive.

Loading comments...