Python Function Argument Unpacking

10 months ago
6

In this example, the display_info function takes three arguments (name, age, and city). Instead of passing each element of the person_info tuple separately, we can use unpacking to pass all elements in a more concise way. The line display_info(*person_info) is equivalent to display_info(person_info[0], person_info[1], person_info[2]).

Loading comments...