I want to teach you one last thing when it comes to lists.
And it's called list unpacking.
And it's a really really nice feature.
I really like it with list and packing.
We can do something like this.
Let's say I have a list that is while very simple 1 2 and 3 and I want to assign a variable to this
list.
Let's call it.
Basket equals one two three.
But what if I wanted to assign a variable to each item.
Well I can actually do something like this A B C so that when I print a.
And then let's print B and then print c and i click Run I get one two three and this is something that
we've seen when we talked about variables where even if it wasn't a list as long as we gave it by comma
separated by comma different values we're able to print one two three.
But this is where list I'm packing gets really really useful.
We can actually let's say extend our list to include all the way till night.
What if we wanted to unpack one two and three byte but keep everything else still in a list.
Could we still do that.
Well with list unpacking we can't.
All we need to do is say comma and then add a star and give it a variable name whatever we like.
Let's say other.
So now if I print other than I click Run look at that I'm able to unpack my list.
However way I want what if I add a comma here and add D
Well if I run this I get a list all the way until 8.
But now D is well actually the very last item so that's very very neat maybe they use case right now
is not absolutely clear to you but this is something that might help you.
Another tool in your toolbox to unpack a list and change a list in different ways we'll explore this
more later on in this course.
But for now less unpacking when you hear that word.
Now you know what it means.
I'll see you in the next one.
Bye bye.