filmov
tv
15 Explanation of Tuple Operation in Python Programming.

Показать описание
There is a very important difference between List and Tupple is that tupple are immutable.
immutable means once tupple are created they cannot be changed.
Even the element of the tupple can't be modified.
Now let's see how we can declare our Tupple.
Now I'm going to declare a variable called X. and I'm going to assign some values to it.
Now in case of a list we have seen we used the square brackets.
In the case of Tupples we use parenthesis to store the list of elements .
Now let me read 1 5 3 4 and 8 as element as example. and then press enter. and it's going to create a tupple.
to print value of a tupple. Type the tupple variable name and enter. The content is displayed.
Now as I said tupple are similar to lists in some ways.
And that means you can call a tupple element by index .
and all tuuple elements are arranged by their index.
for example to get the first element here you give the index 0 and then press enter.
it is going to give you the value which is saved at index 0.
Let's get the value which is saved.
**************************************************************************
please like and follow us in Facebook and Instagram.
immutable means once tupple are created they cannot be changed.
Even the element of the tupple can't be modified.
Now let's see how we can declare our Tupple.
Now I'm going to declare a variable called X. and I'm going to assign some values to it.
Now in case of a list we have seen we used the square brackets.
In the case of Tupples we use parenthesis to store the list of elements .
Now let me read 1 5 3 4 and 8 as element as example. and then press enter. and it's going to create a tupple.
to print value of a tupple. Type the tupple variable name and enter. The content is displayed.
Now as I said tupple are similar to lists in some ways.
And that means you can call a tupple element by index .
and all tuuple elements are arranged by their index.
for example to get the first element here you give the index 0 and then press enter.
it is going to give you the value which is saved at index 0.
Let's get the value which is saved.
**************************************************************************
please like and follow us in Facebook and Instagram.