Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Sagar Thakkar
8,814 Pointshay can any one help me to understand packing and unpacking more please...
i am still confused about concept please help trying from 2 days

Sagar Thakkar
8,814 Pointsya sure its https://www.facebook.com/thakkarsagar12 its not safe to put full contact detail hear meet me there
3 Answers

Kenneth Love
Treehouse Guest TeacherLet's start with you telling me what you understand about packing/unpacking.

Sagar Thakkar
8,814 Pointspacking is like compressing multiple values in single variable without any distortion in values, and unpacking is getting out individual variables from dict or list or single compressed variable
it is really honer to learn from you kenneth. You are one of my favourite teachers.

Kenneth Love
Treehouse Guest TeacherOK, that's a pretty good start.
packing is like compressing multiple values in single variable
Yep, when we pack values that's exactly what we're doing.
When we unpack values, we take them from an iterable and turn them into either new variables or key/value pairs.
a, b, c = (1, 2, 3)
This unpacks the (1, 2, 3)
tuple into the variables a
, b
, and c
.
**{"name": "Kenneth", "language": "Python"}
This would unpack the dictionary into the key/value pair name="Kenneth", language="Python"
, like we would use as the arguments to a function.

Allison Schaaf
33,297 PointsI found this blog helpful http://agiliq.com/blog/2012/06/understanding-args-and-kwargs/

Sagar Thakkar
8,814 Pointsthanks kenneth
Taraj Shah
21,073 PointsTaraj Shah
21,073 PointsHi Sagar, Being on the same boat and in the same city, would like to catch up. Can I have your contact detail?