 Let's have a look at tuples. Now tuples are also lists of values But instead of being enclosed in square brackets, they are closed in parentheses. So these normal round brackets brackets now tuples can be heterogeneous in other words, you'll see I've put the numerical values integer values one two three in here and a string hello But what they are as they are immutable? Immutable means they cannot be changed once they have been created so you have created the computer variable called TUP and Once I've created that it cannot be changed I cannot change a value as I could with arrays and that's one of the big differences between arrays and tuples Let's run this code and we see to our tuple there two three one two three and the word hello Just to make sure the type of it is a tuple and it found a 64 bit integer a 64 bit integer another 64 bit Integer that would be the one two three and then an ASCII string Now we can look up at the value and the type of each element So let's go for I in one to the length of tuples so we can still the elements can still be counted We're gonna print new lines for each time. There's this for loop And we're gonna print out to the screen the value of the tuple at index number Now dollar I because the first time we're gonna be at index one the next time the for loop runs It's in this index to the next one and then we're going to use this tuple and in square brackets It's index value. So that would be exactly the same as a raise. They are still really just indexed starting from one and then we're just going to use the type of What that tuple index and or at least the value of that index is going to be so quite a simple for loop there And we clearly see the value of the tuple at index number one is one and the type of 64 bit integer Until we get to index number four and the value is hello and the type is an ASCII string Now another difference is we can actually name these indices Now Let's just run that. Let me just show you what I mean Now we have the values one one three five seven you see that I have enclosed them in Parenthesis, so this is going to be a tuple. They're four tuples and I've given each of them a name So an index position number one we have the value one and I'm calling it a so a is going to equal one B is going to equal three C is going to equal five and the word seven, which is just a normal computer variable is going to be The number seven so we run that line of code now I can say for I in each of a b c 7 So that actually is just an array of all of these names these computer variables that hold these indexed values in the tuple for me and I can print them and There we see the values one three five and seven now tuples can also be sliced So if I have tuple two here with all of these values, we just run that there is our values And we can use the index keyword end. So what would be the last element? We can slice it from number two to number four. So index two would be the three Index three would be the five index number four would hold the value seven I can also reverse the order all these kind of things that we just did with with a race So end the steps of negative one to the first index so that's just going to reverse the order for me But remember they are immutable So I can't use something like tuple tuple to your tupe to Index number one. I'm going to set that to the value five that is going to give you this set index as no method matching set index Error here, so you can't do that You cannot change it while once it has been Created now the next thing just to remember something else about tuples I can have these tuples inside of tuples So there's a tuple one two three inside of its parentheses, but that is just one of some other tuples So it's a two tuples of tuples and you can see them there at index number one though of tuple three is that whole Tuple one two three it makes up that whole index at index number one But I can well which would see then this this one two three would be index number one The one would be index two the two would be index three and four would be this index But it has a sub index So if I say tupe three four index four that would be this three one hundred and one and From there. I want index two. So what we do is we have these two sets of square brackets Just the order in which it follows and that is going to give us the value 100 I Think that's about enough for of tuples in the next lesson in next section on this lesson We are going to have a look at dictionaries