Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Video Player
00:00
00:00
00:00
- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Recapping Python lists.
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
As a recap,
0:00
a Python list is a way to store many
pieces of data in one container.
0:01
What kind of data?
0:05
Anything.
0:06
You can store any type of Python object in
a list, including integers, strings, and
0:07
even other lists.
0:12
Tuples offer the same functionality
with a slightly different syntax.
0:13
So what's the point?
0:17
Why have a tuple when you also have lists?
0:19
There are some semantic differences, but
the main difference is in mutability.
0:22
Lists are not static.
0:26
We can add elements to them and
remove elements from them.
0:28
This means lists are mutable.
0:31
In other words,
lists can be changed in place.
0:33
Tuples, however, are the opposite.
0:37
They're immutable, they cannot be changed.
0:39
Elements cannot be added,
removed, or reordered.
0:42
Mutability has different advantages and
disadvantages.
0:46
One is not better than the other.
0:49
They just have different use cases.
0:51
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