Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Functions, Packing, and Unpacking!
You have completed Functions, Packing, and Unpacking!
Preview
Now that you understand packing, learn about its opposite: unpacking!
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
It's exploding a Python sequence
into individual variables.
0:00
This is also sometimes
called multiple assignment.
0:01
You'll see this often in function returns,
but
0:04
that's definitely not the only
place where this comes in handy.
0:06
The same is true for packing as well.
0:09
Both packing and unpacking are extremely
useful Python tools that you can take
0:10
advantage of throughout your codebase.
0:14
Here we have a function called unpacker.
0:16
Unpacker doesn't do a whole lot.
0:19
It simply returns a tuple
with three values in it.
0:20
One, two, and three.
0:23
Unpacking, however,
0:25
allows us to assign each of those values
inside the tuple to its own variable.
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up