Python Functions, Packing, and Unpacking Packing and Unpacking Recap of Packing and Unpacking

leo homssi
leo homssi
3,546 Points

plz kan some one help me, i cant get it right:( the only one that i have trubble with is the one that i have to fill in

i cant pass this quiz

leo homssi
leo homssi
3,546 Points

i forgot to add the quiz:" Functions, Packing, and Unpacking"

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 64,015 Points

The key to the fill in question is to realize inside the function is a reference to args. This must be defined somewhere. Since the parameter list is the only available place, args must go there. However, it can be seen that the function is called with multiple arguments. The way to specify that a parameter can accept multiple arguments is to prefix the parameter with an asterisk (*). The asterisk will cause the multiple arguments to be packed into a tuple. Hence, the parameter list should be *args

Post back if you need more help. Good luck!