Recap0:53 with Ashley Boucher
Recapping Python lists.
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 up