Hello, in this last lesson, we are gonna look at tuples. So it's essentially a data very similar to a list. And there's two main sort of differences. One, you create it with a bracket just sequences, not a square bracket. And the other difference is you can actually update data of the tuple. It's essentially read only so this line here would be valid.
So if I were to do in the case of a list or some list, I did three times selecting before in the fourth one, n plus one. So this one, if I were to make it equal to six, for example. And if I were to just copy this line, I'm gonna get a result. What we'll get is people printed out and then updated and then it printed out again, with the data value, so it gets printed out 4.5 then it gets printed out at six, we have the updated value. So let me show you a tuple. So two, awesome is very similar.
So it is, you know, I'll just copy the contents are separated by commas. Copy that inside here. And now to access it, it's very similar. So we just get hold of this, put it here. Instead, we're going to put and if I run that, I haven't actually tried to assign a value to it yet, but we'll get around to that in a moment. So as you can see, the result is the entire list.
First element, the last element, just a couple of the elements and Then your data element. Now the two port, the first element, the last one, and there's a couple of the elements that you can see it's square brackets here, child brackets mean rounded parentheses here. But now if I were to try and do this, so instead, I'm doing awesome to pool. Awesome to pool, click work. We get a runtime. So get an error, because we can't see two bar object does not support item assignment.
So this is in valid. So that's it for two points, very similar to lists. So if you want lift, like functionality, we don't want that a no developer to be able to edit the content, update the contents, then you know, it's a great alternative, a essentially a read only list. Thanks for watching this video. And I look forward to seeing you in the next one.