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

Andrew BoosHartig
Andrew BoosHartig
1,820 Points

When to use *args vs *kwargs

so when you need the output to be a tuple you use *args when strings are the input. but if the input calls a variable you'll want it to be a dictionary and use **kwargs. both strictly used when the amount is unknown? I hope I'm grasping this fully. then i can also convert them back to lists if needed. and these are specific features unique to functions. How do i rationalize my intentions with them?

1 Answer

Andrew BoosHartig
Andrew BoosHartig
1,820 Points

oh **kwargs stands for keyword arguments. that makes sense now.