Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Functions, Packing, and Unpacking Packing and Unpacking Packing

Fradely Dilone
Fradely Dilone
24,037 Points

The result of the tuple is not as in the video on the cli

Code-------- def my_function(*args): for val in args: print(args)

my_function("Hello", "I", "love", "python")

CLI result

python3 functions.py
('Hello', 'I', 'love', 'python')
('Hello', 'I', 'love', 'python')
('Hello', 'I', 'love', 'python')
('Hello', 'I', 'love', 'python')


on the video is

Hello I love python

1 Answer

Ah, don't worry this is a really easy thing to miss. You're function loops through each argument in all arguments. You're currently printing all arguments instead of each argument.

I hope that makes sense. I'm trying to stop short of just giving you the answer, because it always seems to click better when I figure it out, but let me know if it's still confusing.